
Security News
Cline CLI npm Package Compromised via Suspected Cache Poisoning Attack
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.
Utility for converting textual time periods to time units (milliseconds, seconds, minutes, hours, etc..)
In development
First install the package and save it to package.json using npm:
npm install --save to-time
To require in the browser:
<!-- access using window.toTime -->
<script src="node_modules/to-time/lib/to-time.min.js"></script>
To require when using NodeJS:
const toTime = require('to-time');
Converting from textual time period to time units
toTime('1 hour').seconds(); //3600
//same as:
toTime('1h').seconds(); //3600
toTime('1 Year 365 Days 4 Hours').hours(); //17524
//same as:
toTime('1y 365d 4h').hours(); //17524
Useful for usage in methods such as setInterval and setTimeout which consume the intervals in milliseconds
//Instead of using 43200000 milliseconds (equivalent to 12 hours) we can do the following
setInterval(() => {
//Do something here
}, toTime('12h').ms());
//Instead of using 5400000 milliseconds (equivalent to 1.5 hour)
setTimeout(() => {
//Do something here
}, toTime.addHours(1.5).ms());
toTime.fromHours(4).addMinutes(30).hours(); //4.5
toTime.fromYears(4).addWeeks(4).days(); //1488
Make sure to write tests, run new & existing tests using:
npm run test
Check for source code & tests code styling by running eslint:
npm run lint
If tests are passing and eslint doesn't return any error -> Create pull request
MIT
FAQs
Utility for converting textual time periods to time units
We found that to-time 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
A compromised npm publish token was used to push a malicious postinstall script in cline@2.3.0, affecting the popular AI coding agent CLI with 90k weekly downloads.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.

Product
Socket now supports PHP with full Composer and Packagist integration, enabling developers to search packages, generate SBOMs, and protect their PHP dependencies from supply chain threats.