Token JWT Waktu Kedaluwarsa

// it uses npmjs.com/ms utility to convert various time formats to milliseconds
// milliseconds is the default format which is assumed if numeric value is not followed by valid characters
var token = jwt.sign({key_name:'key_value'}, "secret_key", {
  expiresIn: '365d'	// expires in 365 days
});

// other accepted formats
expiresIn('2 days')  // 172800000
expiresIn('1d')      // 86400000
expiresIn('10h')     // 36000000
expiresIn('2.5 hrs') // 9000000
expiresIn('2h')      // 7200000
expiresIn('1m')      // 60000
expiresIn('5s')      // 5000
expiresIn('1y')      // 31557600000
expiresIn('100')     // 100
expiresIn('-3 days') // -259200000
expiresIn('-1h')     // -3600000
expiresIn('-200')    // -200
amit.bhagat