intervals-for-humans
v1.0.4
Published
Convert human-readable intervals like '1h' or '5m' or '15s' into milliseconds
Downloads
68
Readme
intervals-for-humans
Convert human-readable intervals like '1h' or '5m' or '15s' into milliseconds.
Installation
npm install intervals-for-humans
Usage
const i4h = require('intervals-for-humans')
console.log(i4h('1ms')) // 1
console.log(i4h('10s')) // 10000
console.log(i4h('5m')) // 300000
console.log(i4h('2h')) // 7200000
console.log(i4h('1d')) // 86400000
console.log(i4h('3w')) // 1814400000
console.log(i4h('Oops')) // false
Testing
npm run test
Author
👤 Ian M. Goldstein
- Github: @iamigo
Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.
Show your support
⭐️ if this project helped you!
License
Copyright © 2020 Ian M. Goldstein.
This project is MIT licensed.