# node-red-contrib-routing

> A Node-RED node to route incoming messages based on their topics.

Latest version **1.1.0** (published 2018-01-09) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install node-red-contrib-routing
pnpm add node-red-contrib-routing
yarn add node-red-contrib-routing
bun add node-red-contrib-routing
```

## 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.1.0 |
| Published | 2018-01-09 |
| First published | 2018-01-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Antoine Pultier |
| Maintainers | a.pultier |
| Keywords | node-red, routing, router, rlite |

## Links

- npm: https://www.npmjs.com/package/node-red-contrib-routing
- Repository: https://github.com/SINTEF-9012/node-red-contrib-routing
- Homepage: https://github.com/SINTEF-9012/node-red-contrib-routing#readme
- Issues: https://github.com/SINTEF-9012/node-red-contrib-routing/issues
- npm.io page: https://npm.io/package/node-red-contrib-routing

## Dependencies (1)

- [rlite-router](https://npm.io/package/rlite-router.md) ^2.0.3

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2018-01-09
- 1.0.1 — 2018-01-09
- 1.0.0 — 2018-01-09

## README

# node-red-contrib-routing
A Node-RED node to route incoming messages based on their topics.

It is inspired by [Ruby on Rails' routing](http://api.rubyonrails.org/classes/ActionDispatch/Routing.html) and [Express.js' routing](https://expressjs.com/en/guide/routing.html). It uses [rlite](https://github.com/chrisdavies/rlite) to match a message to a single route.

![](https://user-images.githubusercontent.com/45740/34722402-78ef86e2-f54f-11e7-8e56-5411777c80f7.png)

### Example

##### Routes

 * `iot/:sensor/humidity`
 * `iot/:sensor/temperature`
 * `traffic`
 
##### Incomming message

```json
{
    "topic": "iot/AJ08/humidity",
    "payload": "18"
}
```

#### Output

Will match the route `iot/:sensor/humidity` and the forwarded message will be :
```json
{
    "topic": "iot/AJ08/humidity",
    "payload": "18",
    "params": {
        "sensor": "AJ08"
    }
}
```

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