
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
lib-promise-pool
Advanced tools
A nodejs library for executing the job concurrently while controlling the rate of concurrency
A nodejs library for executing the job concurrently while controlling the rate of concurrency
npm i lib-promise-pool -S
import PromisePool from 'lib-promise-pool'
async function worker(d, i) {
// console.log(d, i) //=> 1,1 2,2 3,3
return new Promise(res => setTimeout(() => res(d), d * 1000));
}
const data = [1, 2, 3];
const start = Date.now();
await PromisePool(data, worker, 1);
const end = Date.now();
const diff = end - start
console.log(diff) // 6
// If concurrency is changed to 2
console.log(diff) // 4
// If concurrency is changed to 3
console.log(diff) // 3
PromisePool(array, worker, concurrency=1, options = {stopOnErr: false})
Param | Description |
---|---|
array | Array containing input data to worker |
worker | Async worker function |
concurrency | Number of concurrent jobs to be executed |
options | Options for controlling the execution of jobs |
options.stopOnErr | Whether to stop executing the rest of the promises if a failure is detected. Defaults to false |
npm run test
npm run coverage
This is open-source, which makes it obvious for any PRs, but I would request you to add necessary test-cases for the same
FAQs
A nodejs library for executing the job concurrently while controlling the rate of concurrency
We found that lib-promise-pool 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.