Skip to content

Conversation

@Sharaal
Copy link
Contributor

@Sharaal Sharaal commented May 10, 2017

Because millisecond is not the only format which is needed (e.g. redis expire wants the duration in seconds), I added the opportunity to define the output format.

So instead of:

const m = parse('1hr 20mins') / 1000 / 60;

You can do:

const m = parse('1hr 20mins', 'm');

@Sharaal
Copy link
Contributor Author

Sharaal commented May 10, 2017

See also: https://www.npmjs.com/package/@dnode/parse-duration
If someone also needed this functionality and the PR won't be merged, feel free to use it. :)

@fruch
Copy link

fruch commented Oct 18, 2017

@Sharaal looks like a good idea to me.

just out of curiosity, why did you limit to node 7 and up in you version of the package ?

@Sharaal
Copy link
Contributor Author

Sharaal commented Oct 23, 2017

@fruch Thats not a needed limit for this package.
I have it in all my packages as standard because of async/await (without transpiler) which needs minimum v7.6.

@dy dy merged commit a5e1223 into jkroso:master Apr 22, 2020
@dy
Copy link
Collaborator

dy commented Apr 22, 2020

Thanks, merged/published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants