
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
async-counter
Advanced tools
An asynchronous counter with a sync interface
npm i --save async-counter
import asyncCounter from 'async-counter';
const counter = asyncCounter(2);
// Inside an async block
const logWhenFinished = async () => console.log(`Finished counting to ${await counter}!`);
// Somewhere else, async code
setTimeout(() => counter.count(), 500);
setTimeout(() => counter.count(), 1000);
// `counter` resolves the second time `counter.count` is called
logWhenFinished();
// Output after a second:
// Finished counting to 2!
const counter = asyncCounter(3, {
onFinished: max => console.log(`Finished counting to ${max}!`),
onCount: ({payload, max, current}) => console.log(`${payload.date.toString()}: ${current} of ${max} times`)
});
for (let i = 0; i < 3; i++) {
setTimeout(() => counter.count({date: new Date()}), i * 1000);
}
// Output:
// Wed Feb 27 2019 04:40:05 GMT-0500 (Eastern Standard Time): 1 of 3 times
// Wed Feb 27 2019 04:40:06 GMT-0500 (Eastern Standard Time): 2 of 3 times
// Wed Feb 27 2019 04:40:07 GMT-0500 (Eastern Standard Time): 3 of 3 times
// Finished counting to 3!
FAQs
An asynchronous counter for Node.js and the browser
We found that async-counter 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.