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" }, async ({ left, right }) => left + 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 }, async () => {
console.log(await devis.call({ role: "math", cmd: "sum" }, { left: 1, right: 2 })); // 3
devis.close();
});The client needs no service name: each service announces its patterns, and Devis routes every call to the one that matches best, in turn when several instances run. Since Devis 4.1: partial matching, automatic reconnection, load balancing and OpenTelemetry traces across services, on top of async handlers, timeouts, graceful shutdown and TypeScript types.
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 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.