intervals-for-humans
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

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.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i intervals-for-humans

    Weekly Downloads

    6

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    30 kB

    Total Files

    15

    Last publish

    Collaborators

    • iamigo