# devis_rabbitmq

> Amqp transport plugin for Devis

Latest version **1.0.1** (published 2017-11-25) · ISC license · 0 weekly downloads

## Install

```sh
npm install devis_rabbitmq
pnpm add devis_rabbitmq
yarn add devis_rabbitmq
bun add devis_rabbitmq
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-11-25 |
| First published | 2017-11-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | reida ismail |
| Maintainers | ismailrei |
| Keywords | devis, plugin, amqp, transport, rabbitmq, zmq, activemq, microservice, rpc |

## Links

- npm: https://www.npmjs.com/package/devis_rabbitmq
- npm.io page: https://npm.io/package/devis_rabbitmq

## Dependencies (3)

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

## Recent versions

- 1.0.1 (latest) — 2017-11-25
- 1.0.0 — 2017-11-25

## README

# Devis rabbitMQ transport
 <img  src="https://avatars3.githubusercontent.com/u/21971184?v=4&amp;s=200" href="http://devisjs.surge.sh" width="250" />

>An amqp transport plugin for Devis

## Install 
```bash
    $ npm install --save devis
    $ npm install --save devis_rabbitmq
```

## Example 
* Server.js
```js
const devis = require("devis")
    .plug("devis_rabbitmq");

const rabbitOptions = {
    host: "localhost",
    port: 5672,
    queue: "1x"
}

devis.push({ method: "calculator", action: "add" }, (args, done) => {
    done(null, args.ar1 + args.ar2);
});

devis.listenMQ({ rabbitmq: rabbitOptions }, (err, res) => {
    if (err) console.log(err);
});

```
* Client.js

```js
const devis = require("devis")
    .plug("devis_rabbitmq");

const rabbitOptions = {
    host: "localhost",
    port: 5672,
    queue: "1x"
}

const promise = new Promise((resolve, reject) => {
    devis.clientMQ({ rabbitmq: rabbitOptions }, (err, res) => {
        if (err) reject(err);
        else {
            resolve(res);
        }
    });
});

promise.then((result) => {
    devis.callMQ({ queue: "1x", method: "calculator", action: "add" }, { ar1: 1, ar2: 2 }, (err, res) => {
        console.log(res);
    })
});
```

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