arnaucube
arnaucube/raspberryGPIOhtmlserverPublic Self-hosted repository
raspberryGPIOhtmlserver/node_modules/ms/README.md
node_modules/ms/README.mdRaw
 1# ms.js: miliseconds conversion utility
 2
 3```js
 4ms('2 days')  // 172800000
 5ms('1d')      // 86400000
 6ms('10h')     // 36000000
 7ms('2.5 hrs') // 9000000
 8ms('2h')      // 7200000
 9ms('1m')      // 60000
10ms('5s')      // 5000
11ms('100')     // 100
12```
13
14```js
15ms(60000)             // "1m"
16ms(2 * 60000)         // "2m"
17ms(ms('10 hours'))    // "10h"
18```
19
20```js
21ms(60000, { long: true })             // "1 minute"
22ms(2 * 60000, { long: true })         // "2 minutes"
23ms(ms('10 hours'), { long: true })    // "10 hours"
24```
25
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
29a number (e.g: it returns `100` for `'100'`).
30- If you pass a string with a number and a valid unit, the number of
31equivalent ms is returned.
32
33## License
34
35MIT