
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@xeoneux/millisecond
Advanced tools
Parse strings that indicate a time to their millisecond equivalents.
This module is written with Node.js and Browserify in mind and can therefor be installed using the node package manager:
npm install --save millisecond
The module exposes one single function interface, so you simply require it using:
'use strict';
var ms = require('millisecond');
And to parse a string simply supply it as first argument and it will return
a number. If we're unable to parse it, we will automatically return 0.
ms('1 second'); // returns 1000
ms('1 ms'); // returns 1
ms('10 cows'); // returns 0
It understands the following strings:
x millisecondsx millisecondx msecsx msecx msx secondsx secondx secsx secx sx minutesx minutex minsx minx mx hoursx hourx hrsx hrx hx daysx dayx dx weeksx weekx wksx wkx wx yearsx yearx yrsx yrx yThe space after the number is optional so you can also write 1ms instead of 1 ms. In addition to that it also accepts numbers and strings which only includes
numbers and we assume that these are always in milliseconds.
This module is heavily inspired by the ms module which is also licensed under
MIT. If you also need to transform numbers back in to strings I suggest you look
at that library.
FAQs
Convert time strings to milliseconds
We found that @xeoneux/millisecond demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.