Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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
The npm package async-counter receives a total of 75 weekly downloads. As such, async-counter popularity was classified as not popular.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.