# amqp-modern

> Wrapper around amqplib that brings the client syntax into 2018

Latest version **0.0.10** (published 2020-06-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install amqp-modern
pnpm add amqp-modern
yarn add amqp-modern
bun add amqp-modern
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2020-06-13 |
| First published | 2018-07-31 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Zach Silveira |
| Maintainers | zackify |
| Keywords | amqp, queue, rabbitmq |

## Links

- npm: https://www.npmjs.com/package/amqp-modern
- Repository: https://github.com/crossfield/amqp-modern
- Homepage: https://github.com/crossfield/amqp-modern#readme
- Issues: https://github.com/crossfield/amqp-modern/issues
- npm.io page: https://npm.io/package/amqp-modern

## Dependencies (1)

- [amqplib](https://npm.io/package/amqplib.md) ^0.5.2

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 0.0.10 (latest) — 2020-06-13
- 0.0.9 — 2020-06-12
- 0.0.8 — 2019-02-20
- 0.0.7 — 2019-02-20
- 0.0.6 — 2018-11-01
- 0.0.5 — 2018-11-01
- 0.0.4 — 2018-11-01
- 0.0.3 — 2018-08-21
- 0.0.2 — 2018-08-10
- 0.0.1 — 2018-07-31

## README

## AMQP Modern

A small `amqplib` wrapper for nodejs that simplifies interactions with queue systems.

- Consuming a channel
- Async / Await based
- Publishing to a channel
- Passing off JS objects, so you don't have to
- It handles rejections and acknowledgments automatically

## Install

```
npm install amqp-modern
```

## Usage

```js
import amqp from 'amqp-modern';

let client = amqp('amqp://connection string here');

//optional config
client.config({
  //catch and log any time a queue has an error
  onError: error => console.log(error),
  //wait 10 seconds after each failure, useful to not reject and retry instantly, probably looping really fast
  rejectionDelay: 10000,
});

//consume a channel
client.consume({
  channel: 'message',

  process: async message => {
    await sendAnEmail(message.description);
    //if this promise rejects, the queue will retry
  },
});

//somewhere in your app, publish to a channel

client.publish('message', { description: 'hello!' });
```

---
_Source: https://npm.io/package/amqp-modern · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
