# noni

> Koa-inspired queue middleware framework for node.js

Latest version **0.0.4** (published 2017-12-03) · MIT license · 0 weekly downloads

## Install

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

## 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.4 |
| Published | 2017-12-03 |
| First published | 2017-12-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | levk |
| Maintainers | any4 |

## Links

- npm: https://www.npmjs.com/package/noni
- Repository: https://github.com/lev-kuznetsov/noni
- Homepage: https://github.com/lev-kuznetsov/noni#readme
- Issues: https://github.com/lev-kuznetsov/noni/issues
- npm.io page: https://npm.io/package/noni

## Dependencies (3)

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

## Recent versions

- 0.0.4 (latest) — 2017-12-03
- 0.0.3 — 2017-12-03
- 0.0.2 — 2017-12-03
- 0.0.1 — 2017-12-03

## README

[![Build Status](https://travis-ci.org/lev-kuznetsov/noni.svg?branch=master)](https://travis-ci.org/lev-kuznetsov/noni)

Expressive message passing framework inspired by koa.

Using with AMQP:

```
import {connect} from 'amqplib'
import {amqp, Context} from 'noni'

let connection = await connect('amqp://localhost')
let channel = await connection.createChannel()

// Create a publisher, publisher is a function that accepts
// an object which will become body of the message. Factory
// accepts middleware array as the first argument and
// destination options as the second. AMQP publisher
// middleware has the message as a Buffer, amqp.assemble
// middleware will stringify and convert to buffer contents
// of context.body setting appropriate content headers.
let publisher = amqp.publisher([amqp.assemble], {channel, exchange: 'e', route: 'r'})

// Register a consumer applying successive middlewares to
// received message. AMQP consumer middleware has the message
// as type Message of amqplib, amqp.parse middleware will
// parse the message the message in the buffer as a JSON
// string according to the content headers.
let consumer = await amqp.consumer([
  amqp.parse,
  async (context: Context<Message>): Promise<any> => {
    console.log('Received', context.body)
  }
], {channel, exchange: 'e', route: 'r'})

// Publish a message
publisher({foo: 'bar'})
```

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