Easy time
Tiny tool to deal with time conversions.
//defaultexpire_time = 5minutesexpire_time == 5 //trueexpire_time === 5 //false+expire_time === 5 //true token = jwtkey = useremail + '_token'redisredis //functionaltimeout = ;
To install with npm use:
$ npm install easy-time
Then import with:
- Node
options//oroptions
- Web
Options
Singular
- singular :
Boolean
- default :
false
Includes singular version of getters
Example:
- Node
singular:true; console;
- Web
Table
- table :
Array<String>
- default :
['milliseconds', 'seconds', 'minutes', 'hours', 'days', 'months', 'years']
Include units starting from milliseconds going to the next unit each time. Weeks, centuries and greater units than centuries are excluded by default. You can give your own names if you find the originals redundant.
Example:
- Node
table:'msec' 'sec' 'min'; console;
- Web