time-f

0.0.1 • Public • Published

time-f

Build Status

This library provides a function.The function, time(), converts arguments into a time based value.

Usage

const time = require('time-f');
const str = '1h 15m';
const time1 = time(str);
const time2 = time(1, 15, 0);
console.log(time1); // 4.5e+6 milliseconds
console.log(time2); // 4.5e+6 milliseconds

For example, time() can be used in setInterval().

setInterval(f, time('5sec'));

Compared with 5000, time('5sec') is human-readable.

Readme

Keywords

none

Package Sidebar

Install

npm i time-f

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • pandanoir