Human Interval to Milliseconds
$ npm install human-to-milliseconds
Converts human intervals to milliseconds. This accepts durations such as "300s", "1.5h" or "2h45m". Valid time units are: "ns", "us" (or "µs"), "ms", "s", "m", "h".
$ npm install --save human-to-milliseconds
The code published to npm that gets loaded on require is in fact an ES5 transpiled version with the right shims added. This means that you can require it and use with your favorite bundler without having to adjust asset management process.
const HumanToMilliseconds = require('human-to-milliseconds')
<script>
tagLoading this module through a script tag will make the HumanToMilliseconds
obj available in the global namespace.
<script src="https://unpkg.com/human-to-milliseconds/dist/index.min.js"></script>
<!-- OR -->
<script src="https://unpkg.com/human-to-milliseconds/dist/index.js"></script>
try {
console.log(HumanToMilliseconds('1h50m'))
} catch (err) {
console.log(err)
}
© 2010 - cnpmjs.org x YWFE | Home | YWFE