0.1.3 • Published 3 years ago

string-to-timedelta v0.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

String to Timedelta

This library allows you to convert human-readable time strings (like 10 seconds, 5 minutes, 5 hours) to milliseconds.

How to use

This library includes both a test() function and a parse() function. The test function tests to see if it is a valid time string. Parsing converts the string to milliseconds. Here is a working example:

strToTimedelta = require('string-to-timedelta')
string = '1d1h1s'

console.log(strToTimedelta.test(string))
// returns True
console.log(strToTimedelta.parse(string))
// returns 90001000 milliseconds
0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago