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.
amqp-delegate
Advanced tools
A very simplistic, but performant, remote worker system that uses AMQP to coordinate jobs.
A very simplistic, but performant, remote worker system that uses AMQP to coordinate jobs.
branch | status | coverage | notes |
---|---|---|---|
develop | Work in progress | ||
master | Latest stable release |
const { makeWorker } = require('amqp-delegate')
const worker = makeWorker({
url: <the url of the amqp server> - defaults to ampq://localhost,
name: <the name of the worker> — required,
task: <any pure async function> — required
onError: err => { // optional
console.error('A connection error happened', err) // or do something clever
}
onClose: () => { // optional
console.log('The connection has closed.') // or do something clever
}
})
// start it
worker.start().then(() => {
console.log('worker', worker.name, 'started')
})
// stop it
worker.stop().then(() => {
console.log('worker', worker.name, 'stopped')
})
const { makeDelegator } = require('amqp-delegate')
const delegator = makeWorker({
exchange: <the name of the exchange to use> — defaults to '',
url: <the url of the amqp server> - defaults to ampq://localhost,
onError: err => { // optional
console.error('A connection error happened', err) // or do something clever
}
onClose: () => { // optional
console.log('The connection has closed.') // or do something clever
}
})
delegator
.start()
.then(() => {
delegator.invoke('worker name', ...params)
console.log('job name', result)
})
.catch(err => {
console.error('worker name', err)
})
const task = (a, b) =>
new Promise(resolve => setTimeout(() => resolve(a + b), 10))
const worker = makeWorker({
name: 'adder',
task
})
worker
.start()
.then(() => {
process.on('SIGINT', () => {
worker
.stop()
.then(() => {
process.exit(0)
})
})
})
.catch(err => {
console.error('caught', err)
})
const delegator = makeDelegator()
delegator
.start()
.then(() => delegator.invoke('adder', 10, 15))
.then(result => {
console.log('result', result)
})
.catch(err => {
console.error('caught', err)
})
nvm
to manage Node versions — brew install nvm
.)npm install
docker-compose up -d
Runs Rabbit MQ.
npm test
— runs the unit tests (does not need rabbitmq)npm run test:unit:cov
— runs the unit tests with code coverage (does not need rabbitmq)npm run test:integration
— runs the integration tests (needs rabbitmq)note Node 11.7+ breaks nyc
and mocha
— see https://github.com/nodejs/node/issues/25650
npm run lint
Please see the contributing notes.
FAQs
A remote worker system that uses AMQP to coordinate jobs.
The npm package amqp-delegate receives a total of 6 weekly downloads. As such, amqp-delegate popularity was classified as not popular.
We found that amqp-delegate 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.