1.0.4 • Published 4 years ago

intervals-for-humans v1.0.4

Weekly downloads
168
License
MIT
Repository
github
Last release
4 years ago

Build Status Coverage Status Documentation Maintenance License: MIT

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

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.