# amqplib-rpc-client

> Rpc client based on amqplib.

Latest version **1.0.2** (published 2017-10-09) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install amqplib-rpc-client
pnpm add amqplib-rpc-client
yarn add amqplib-rpc-client
bun add amqplib-rpc-client
```

## 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.2 |
| Published | 2017-10-09 |
| First published | 2016-05-20 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 6 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Tim Allen |
| Maintainers | timlesallen |
| Keywords | amqp amqplib rabbitmq rpc |

## Links

- npm: https://www.npmjs.com/package/amqplib-rpc-client
- Repository: https://github.com/noblesamurai/amqplib-rpc-client
- Homepage: https://github.com/noblesamurai/amqplib-rpc-client#readme
- Issues: https://github.com/noblesamurai/amqplib-rpc-client/issues
- npm.io page: https://npm.io/package/amqplib-rpc-client

## Dependencies (1)

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

## Recent versions

- 1.0.2 (latest) — 2017-10-09
- 1.0.1 — 2017-10-09
- 1.0.0 — 2016-05-20

## README

# amqplib-rpc-client

Rpc client based on amqplib.

[![build status](https://secure.travis-ci.org/timothyleslieallen/amqplib-rpc-client.png)](http://travis-ci.org/timothyleslieallen/amqplib-rpc-client)

## Installation

This module is installed via npm:

``` bash
$ npm install amqplib-rpc-client
```

## Example Usage

``` js
var amqplibRpcClient = require('amqplib-rpc-client'),
    expect = require('expect.js');

amqplibRpcClient(amqpUrl, exchange, 'add', { number1: 1, number2: 4 }).on('data', function(response) {
  expect(response.answer).to.be(5);
});
```

## Usage/conventions
Uses the `replyTo` field to transmit the expected routingKey a response should be publish on by the server.
Expects message to be valid JSON.
Will `emit()` events based on the `type` field of the message content.  The entire JSON object is given as arg 2.  e.g:
`emit('data', { type: 'data', result: 'moo' });`

## Running tests
```
npm test
```

To run the tests RabbitMQ is required. Either install it with your package
manager, or use docker to run a RabbitMQ instance.

```
docker run -d --name amqp.test -p 5672:5672 rabbitmq
```

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