]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blob - example/iot-gateway/node_modules/ms/README.md
Initial commit
[apps/tidep0084.git] / example / iot-gateway / node_modules / ms / README.md
1 # ms.js: miliseconds conversion utility
3 ```js
4 ms('2 days')  // 172800000
5 ms('1d')      // 86400000
6 ms('10h')     // 36000000
7 ms('2.5 hrs') // 9000000
8 ms('2h')      // 7200000
9 ms('1m')      // 60000
10 ms('5s')      // 5000
11 ms('100')     // 100
12 ```
14 ```js
15 ms(60000)             // "1m"
16 ms(2 * 60000)         // "2m"
17 ms(ms('10 hours'))    // "10h"
18 ```
20 ```js
21 ms(60000, { long: true })             // "1 minute"
22 ms(2 * 60000, { long: true })         // "2 minutes"
23 ms(ms('10 hours'), { long: true })    // "10 hours"
24 ```
26 - Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download).
27 - If a number is supplied to `ms`, a string with a unit is returned.
28 - If a string that contains the number is supplied, it returns it as
29 a number (e.g: it returns `100` for `'100'`).
30 - If you pass a string with a number and a valid unit, the number of
31 equivalent ms is returned.
33 ## License
35 MIT