Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Anton is designed to help you to process hard jobs made easy =D
npm install anton2
Anton is a queue manager build on top of bull that simplify the way to process hard jobs. The lifecycle in Anton is:
After the bootstrap of Anton(loading tasks and transporters) you can create your jobs. When the jobs is done, with errors or not, the postback is called and notify you about the result of the job.
var Anton = require('anton2');
var emailJob = Anton.sample.tasks.email; // Load a simple job that send emails in batch.
var transporter = Anton.sample.transport.email; // Load a simple transport for the postback information about the jobs finished. On this case send to your email.
var anton = new Anton();
//One time the jobs and transporters are loaded its loaded in memory every time.
anton
.loadTask(emailJob)
.loadTransporter(transporter)
.createJob('email.job', {
email: {
subject: 'Just a simple test',
from: 'noreply@antonproj.org',
text: 'Hello {{name}}',
html: '<html><body>Hello {{name}}</body></html>',
data: [{
to: 'marcos@thedon.com.br',
name: 'Marcos'
}]
},
credentials: {
sendgrid_api_key: process.env.SENDGRID_API_KEY
}
});
// you can listen for jobs in the queue.
anton.jobs['email.job'].on('completed', function(job){
console.log(job.jobId, 'is complete');
});
anton.jobs['email.job'].on('failed', function(job, error){
console.log(job.jobId, 'is failed', error);
});
The task need be a function that will receive a Task object to create a new taskQueue. Redis connection information will be setted in the task function. See more in this example
The transporter need be a function that will receibe a data object with the information about the job results(data.results) and send to anywhere you must be! See more in this example
Both type and data are required to create an job. The return is a promise with a job object where you can find the jobId.
Both type and id are required to delete a job. The return will be a promise with the job object of the removed job.
taskName is required to identify the right task and clear the jobs errored with least 5 seconds. The return will be a list with the removed jobs.
All help is very welcomed! Just send a Pull Requests or open an Issue
FAQs
Fantastic Job Queue Worker
We found that anton2 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.