Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
beanstalkd
Advanced tools
A low-level* beanstalkd client for Node.js. Inspired by the great work on fivebeans but updated to ES6 and promises.
* The client will handle connections and command request/responses, but does not setup everything required to run workers.
For a high level beanstalkd worker client, see node-beanstalkd-worker
$ npm install --save beanstalkd
import Beanstalkd from 'beanstalkd';
const beanstalkd = new Beanstalkd(host, port);
beanstalkd.connect().then(function (beanstalkd) {
// Verbosely put a new job
beanstalkd.use(tube).then(function () {
return beanstalkd.put(priority, delay, ttr);
});
// Or use fancy bluebird features
beanstalkd.call('use', tube)
.call('put', priority, delay, ttr);
// Close when done
beanstalkd.quit();
});
All beanstalkd commands are implemented per the protocol. Method names are the same as beanstalk command names camelCased, list-tubes-watched becomes listTubesWatched.
Beanstalkd.prototype.protocol|beanstalkd.protocol
exposes the internal instance of beanstalkd-protocol
used for command building and reply parsing.
Beanstalkd.addCommand(command, expectedResponse)
lets you add new commands.
import Beanstald from 'beanstalkd';
Beanstalkd.prototype.protocol.addType('key', String);
Beanstalkd.prototype.protocol.addCommand('AUTH <key>\r\n');
Beanstalkd.prototype.protocol.addReply('OK\r\n');
Beanstalkd.prototype.protocol.addReply('AUTH_FAILED\r\n');
Beanstalkd.addCommand('AUTH', 'OK');
Use DEBUG=beanstalkd*
to enable verbose debugging.
FAQs
A beanstalkd client for Node.js with promises
We found that beanstalkd 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.
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.