# jackrabbit

> Easy RabbitMQ for node

Latest version **4.4.0** (published 2018-10-17) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.4.0 |
| Published | 2018-10-17 |
| First published | 2014-09-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/jackrabbit) |
| Module format | CommonJS |
| Node | >= 0.10.x |
| Dependencies | 3 |
| Unpacked size | 31.6 KB |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 291 |
| Author | Hunter Loftis |
| Maintainers | hunterloftis, matmar10 |
| Keywords | amqp, rabbit, job, jobs, queue, task, resqueue |

## Links

- npm: https://www.npmjs.com/package/jackrabbit
- Repository: https://github.com/hunterloftis/jackrabbit
- Issues: https://github.com/hunterloftis/jackrabbit/issues
- npm.io page: https://npm.io/package/jackrabbit

## Dependencies (3)

- [uuid](https://npm.io/package/uuid.md) ^3.3.2
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [amqplib](https://npm.io/package/amqplib.md) ^0.4.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

- 4.4.0 (latest) — 2018-10-17
- 4.3.0 — 2016-01-20
- 4.2.0 — 2016-01-20
- 4.1.0 — 2016-01-19
- 4.0.3 — 2015-11-18
- 4.0.2 — 2015-10-05
- 4.0.1 — 2015-09-16
- 4.0.0 — 2015-09-15
- 3.0.9 — 2015-08-06
- 3.0.8 — 2014-11-15
- 3.0.7 — 2014-11-15
- 3.0.6 — 2014-11-15
- 3.0.5 — 2014-11-15
- 3.0.4 — 2014-11-15
- 3.0.3 — 2014-11-15
- … 9 more at https://npm.io/package/jackrabbit/versions

## README

# Jackrabbit

[![Build Status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url]

[RabbitMQ](https://www.rabbitmq.com/) in Node.js without hating life.

## Simple Example

*producer.js:*

```js
var jackrabbit = require('jackrabbit');
var rabbit = jackrabbit(process.env.RABBIT_URL);

rabbit
  .default()
  .publish('Hello World!', { key: 'hello' })
  .on('drain', rabbit.close);
```

*consumer.js:*

```js
var jackrabbit = require('jackrabbit');
var rabbit = jackrabbit(process.env.RABBIT_URL);

rabbit
  .default()
  .queue({ name: 'hello' })
  .consume(onMessage, { noAck: true });

function onMessage(data) {
  console.log('received:', data);
}
```

## Ack/Nack Consumer Example

```js
var jackrabbit = require('jackrabbit');
var rabbit = jackrabbit(process.env.RABBIT_URL);

rabbit
  .default()
  .queue({ name: 'important_job' })
  .consume(function(data, ack, nack, msg) {

    // process data...
    // and ACK on success
    ack();

    // or alternatively NACK on failure
    // NOTE: this will requeue automatically
    nack();

    // or, if you want to nack without requeue:
    nack({
      requeue: false
    });
  })
```

Jackrabbit is designed for *simplicity* and an easy API.
If you're an AMQP expert and want more power and flexibility,
check out [Rabbot](https://github.com/arobson/rabbot).

## More Examples

For now, the best usage help is can be found in [examples](https://github.com/hunterloftis/jackrabbit/tree/master/examples),
which map 1-to-1 with the official RabbitMQ tutorials.

## Installation

```
npm install --save jackrabbit
```

## Tests

The tests are set up with Docker + Docker-Compose,
so you don't need to install rabbitmq (or even node)
to run them:

```
$ docker-compose run jackrabbit npm test
```

If using Docker-Machine on OSX:

```
$ docker-machine start
$ eval "$(docker-machine env default)"
$ docker-compose run jackrabbit npm test
```

[npm-image]: https://img.shields.io/npm/v/jackrabbit.svg?style=flat-square
[npm-url]: https://npmjs.org/package/jackrabbit
[travis-image]: https://travis-ci.org/hunterloftis/jackrabbit.svg?branch=master
[travis-url]: https://travis-ci.org/hunterloftis/jackrabbit

## Release

Releases should be tagged according to [Semantic Versioning](https://semver.org/)

Process:

- Add release notes to `releases.md`
- Commit add push the release notes `git commit releases.md && git push origin master`
- Release it `./node_modules/release-it/bin/release-it.js`

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