Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
css-duration
Advanced tools
Converts CSS-style durations to milliseconds.
var duration = require("css-duration")
duration('1000ms')
// > 1000
duration('1.5s')
// > 1500
duration('30m')
// > 1800000
duration('8h')
// > 28800000
duration('2d')
// > 172800000
npm install --save css-duration
duration(time)
Normalizes "unit-based time" (similar to CSS values) into a Number
of milliseconds.
time
(String
): A CSS-style value of a duration of time (i.e. 10s
, 5h
, 0.5d
)ms
: Millisecondss
: Secondsh
: Hoursd
: Daysw
: WeeksNote: Anything past seconds is not a valid CSS unit. Use another package for validating.
duration('0.25d')
// => 21600000
duration('-1w')
// => -604800000
MIT © Brandon Semilla
FAQs
Converts CSS-style durations to milliseconds.
The npm package css-duration receives a total of 65 weekly downloads. As such, css-duration popularity was classified as not popular.
We found that css-duration demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.