Mali is a minimalistic, middleware-based gRPC microservice framework for Node.js, designed to simplify the creation of gRPC servers. It operates similarly to popular HTTP frameworks like Koa or Express, leveraging a context object (`ctx`) for request and response handling within a cascading middleware pattern. The current stable version is `0.47.1`. The project maintains a regular, albeit not rapid, release cadence, primarily focusing on dependency updates, performance improvements, and bug fixes, as seen in recent versions like `v0.47.0` and `v0.46.0`. Its key differentiator lies in its commitment to minimalism and a familiar middleware API for gRPC, abstracting away some of the complexities of the underlying `@grpc/grpc-js` and `@grpc/proto-loader` libraries, which are required as peer dependencies. It also ships with TypeScript types.
npm install maliVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates setting up a basic Mali gRPC server, defining a simple 'Greeter' service with a 'SayHello' method, and then creating a client to interact with it. It includes the necessary proto definition and server startup/shutdown.
Upgrade Node.js to version 16 or newer. The project recommends Node.js 18+ for best compatibility and features.
Ensure direct dependencies are explicitly installed if your project relied on them. Review your package's dependency tree for unexpected removals.
Upgrade to `v0.44.3` or newer to get the corrected TypeScript declarations.
Upgrade to `v0.44.2` or newer to resolve the namespace omission bug. Review your `.proto` files if they use `type` as a namespace key and test thoroughly.
Upgrade to `v0.47.1` or newer to ensure response metadata is always sent, even when an error occurs during processing.
Upgrade `mali` to `v0.44.3` or newer. Ensure correct method signature according to documentation if not using TypeScript.
Run `npm install mali @grpc/grpc-js @grpc/proto-loader` to ensure all necessary peer dependencies are installed.
Verify the server is running on the specified port and address. Check firewall rules. Ensure the client connection string matches the server's listening address.