Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
jobs-queues
Advanced tools
Plugin that gives you sequential queues for your jobs as Array-like Objects in Express style
npm i jobs-queues
npm test
const jobsQueues = require( 'jobs-queues' );
const queue = jobsQueues();
queue.push( //Push a job list
( finish ) => {
// Any job
setTimeout( () => {
console.log( 'First job finished' );
finish( true, 'Hello world!' ) // At the end call finish() with your results
}, 2500 );
},
( finish, empty, ...results ) => {
// Another job
if ( results[0] ) {
finish( results[1] ); // Call finish() with your result
} else { // OR
empty(); // Stop this job list
}
console.log( 'Second job finished' );
},
async ( finish, empty, result ) => {
// Another job
await new Promise( r => setTimeout( r, 500 ) );
console.log( result );
finish(); // Call finish()
}
);
queue.push(
( finish ) => {
console.log( 'Another job list' );
finish();
}
);
queue.onError( ( err, refs ) => {
console.log( { err, refs } );
} );
jobsQueues( started = true [, ...jobList: Function] );
started
Default true
- Set to false
if you want to start your jobs laterjobList
Optional - Any function that accepts three parameters:
finish
Required - A callback you have to call at the end of every job. It accepts ...results
and pass them to the next job in the same job listempty
Optional - A callback you have to call to stop the jobs in the same job list...results
Optional - Any result yo have passed in the finish()
of the previous one job in the same job listA JobsQueues
instance that extends Array
push
queue.push( ...jobList );
The index of the job list as Integer
start
queue.start();
onError
queue.onError( callback );
callback
Required - A function that accepts error
and referements
of the interrupted job list index and job index (in the order you've pushed them)A job list is not directly related with errors of another. It runs in anyway when the previous one exits.
FAQs
A sequential jobs manager in Express.js style
The npm package jobs-queues receives a total of 0 weekly downloads. As such, jobs-queues popularity was classified as not popular.
We found that jobs-queues 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.