Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
A simple and elegant AMQP client written by TypeScript
Inspired by amqp-ts
import * as amqp from 'amqpr';
// const amqp = require("amqpr"); // js require
async function run() {
const connection = new amqp.Connection('amqp://localhost');
const exchange = connection.declareExchange('ExchangeName');
const queue = connection.declareQueue('QueueName');
await queue.bind(exchange);
await queue.consume(message => {
console.log('Message received: ' + message.getContent());
});
// it is possible that the following message is not received because
// it can be sent before the queue, binding or consumer exist
const msg = new amqp.Message('Test');
exchange.send(msg);
await connection.ready();
// the following message will be received because
// everything you defined earlier for this connection now exists
const msg2 = new amqp.Message('Test2');
exchange.send(msg2);
}
run().catch(console.error);
More examples can be found in the tutorials directory.
connection.connected
: Returns true if the connection exists and false, otherwise.connection.online()
: Resolved when connected.connection.ready()
: Resolved when connected and all resources(actors) has been ready.When the library detects that the connection with the AMQP server is lost, it tries to automatically reconnect to the server.
It is powered by connback.
FAQs
A simple and elegant AMQP client
We found that amqpr 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.