gm-parse-duration

Parses string representations of time into milliseconds

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
gm-parse-duration
001.0.610 years ago10 years agoMinified + gzip package size for gm-parse-duration in KB

Readme

parse-duration
Parses duration strings into milliseconds

Installation

Browserify/NPM
$ npm install --save gm-parse-duration

var parse = require('gm-parse-duration');

Component
$ component install charlottegore/parse-duration

var parse = require('parse-duration');

API

var parse = require('parse-duration');

parse(1000) === 1000; 
parse('100ms') === 100;
parse('100s') === 6000000;
...
And so on. Supports ms (miliseconds), s (seconds), m (minutes), h (hours), d (days) and w (weeks).

License

MIT