Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
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 milliseconds
x millisecond
x msecs
x msec
x ms
x seconds
x second
x secs
x sec
x s
x minutes
x minute
x mins
x min
x m
x hours
x hour
x hrs
x hr
x h
x days
x day
x d
x weeks
x week
x wks
x wk
x w
x years
x year
x yrs
x yr
x y
The 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.
MIT
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
The npm package millisecond receives a total of 12,166 weekly downloads. As such, millisecond popularity was classified as popular.
We found that millisecond demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.