Skip to content

iamigo/intervals-for-humans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Convert human-readable intervals like '1h' or '5m' or '15s' into milliseconds

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors