@amaui/amqp
TypeScript icon, indicating that this package has built-in type declarations

1.1.19 • Public • Published

amaui logo

amaui AMQP

AMQP


MIT license     Production ready     100% test cov     Nodejs

Very simple code     Modern code     Junior friendly     Typescript     Made with 💛


Getting started

Add

yarn add @amaui/amqp

Add amqplib peer dependency.

yarn add amqplib

Use

  import AmauiAmqp from '@amaui/amqp';
  // Make if you wanna a config file and
  // inside of it add all the process.env related props
  import Config from './config';

  // Make a new amqp instance
  const amauiAmqp = new AmauiAmqp({
    uri: Config.amqp.rabbitmq.uri,
    queues: Config.amqp.rabbitmq.queues,
    exchanges: Config.amqp.rabbitmq.exchanges,
  });

  // Await for a channel
  await amauiAmqp.channel;

  // Send to a queue
  await amauiAmqp.send('a', 'a');

  // Check a queue
  await amauiAmqp.checkQueue();

  // { queue: 'a', messageCount: 1, etc. }

Dev

Install

yarn

Test

yarn test

One time local setup

Install docker and docker-compose

Make docker containers

yarn docker

Prod

Build

yarn build

Package Sidebar

Install

npm i @amaui/amqp

Weekly Downloads

38

Version

1.1.19

License

MIT

Unpacked Size

30.1 kB

Total Files

9

Last publish

Collaborators

  • lazareric