Node.js client for the qrusty priority queue server API.
npm install qrusty-clientNode.js client for the qrusty priority queue server API.
- Connect to a qrusty server
- Publish, consume, ack, and purge messages
- List and manage queues
- Promise-based API using axios
``bash`
npm install qrusty-client
`js
const QrustyClient = require("qrusty-client");
const client = new QrustyClient("http://localhost:6784");
(async () => {
await client.createQueue("orders", "MaxFirst", true);
await client.publish("orders", 100, { order_id: 123 });
const msg = await client.consume("orders", "worker-1");
if (msg) {
await client.ack("orders", msg.id, "worker-1");
}
})();
`
Generate HTML docs with:
`bash`
npm run docs
Run unit tests with:
`bash`
npm test
1. Log in to npm (if you haven't):
`bash`
npm login
2. Publish the package:
`bash`
npm publish
- You need an npm account (
- Run npm login and enter your username, password, and email~/.npmrc` for publishing
- This stores your credentials in
MIT