Pattern-matching microservices for Node.js. Register handlers under plain-object patterns, then call them in the same process or over TCP, Unix sockets, named pipes or RabbitMQ, with the same calling code.
// math.js
const devis = require("devis");
devis.push({ role: "math", cmd: "sum" }, (args, done) => done(null, args.left + args.right));
devis.listen({ host: "127.0.0.1", port: 3030 });// client.js
const devis = require("devis");
devis.connect({ id: "math", host: "127.0.0.1", port: 3030 }, () => {
devis.call({ clientId: "math", role: "math", cmd: "sum" }, { left: 1, right: 2 }, (err, result) => {
console.log(result); // 3
});
});npm install devis # Node.js 22 or later| Package | What it does | |
|---|---|---|
| devis | The framework: patterns, local calls, TCP, Unix sockets, named pipes | |
| devisPattern | The exact-match pattern matcher behind Devis | |
| devis-mongo-client | MongoDB plugin | |
| devis-pub_sub-redis | Redis pub/sub plugin | |
| devis_rabbitmq | RabbitMQ transport with per-call RPC replies | |
| generator-devis | yo devis: scaffold a gateway and a microservice |
- Read the devis README for the API and recipes.
- Run the examples: local calls, TCP, MongoDB, Redis, RabbitMQ.
- Scaffold a project:
npm install -g yo generator-devis && yo devis.
All packages are MIT licensed and tested on Node.js 22 and 24.