Human-interval

human-interval

Human readable interval parser.

human-interval with 60 lines of code and some smart use of regexps provides a easy way to parser intervals in human readable form.

Get it: npm install --save human-interval

Sample usage:

1
2
3
4
5
const humanInterval = require('human-interval');

setTimeout(() => {
  // Do something crazy!
}, humanInterval('three minutes'));
1
2
3
4
humanInterval('one minute');
humanInterval('1.5 minutes');
humanInterval('3 days and 4 hours');
humanInterval('3 days, 4 hours and 36 seconds');

GIF FTW!

human-interval

Suggest a module

Comments