1.0.6 • Published 5 years ago
variable-ms v1.0.6
Convert various time formats to milliseconds
Examples
- Convert
'2 days'
(string) to172800000
(number)string to number
- Convert
60000
(number) to60000
(number)without changes
Installation
$ yarn add variable-ms
Usage
import ms from 'variable-ms';
let milliseconds;
milliseconds = ms('2 days');
console.log(milliseconds); // 172800000
milliseconds = ms(60000);
console.log(milliseconds); // 60000
Author
Miguel Padrino |