Simple gRPC Connector v1.0.7 is a lightweight JavaScript library that wraps @grpc/grpc-js to allow publishing arbitrary JavaScript functions, objects, and services as gRPC endpoints with minimal configuration. It provides automatic serialization/deserialization, optional SSL/TLS, and a promise-based client for calling remote functions by name. Unlike full-featured gRPC frameworks (e.g., NestJS, gRPC-Web), this library prioritizes zero-boilerplate integration for small-to-medium services. It is maintained on GitHub and follows an ad-hoc release cadence.
npm install simple-grpc-connectorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a server that publishes a service object with two functions, then creating a client that calls the add function remotely.
Always publish an object with named keys (e.g., { myFunc }) or use call('functionName') for named methods.Ensure all arguments and return values are JSON-serializable. Complex types (e.g., Dates) may be serialized unexpectedly.
Always pass arguments as an array, even for a single parameter: call('fn', [arg])Refer to @grpc/grpc-js documentation for SSL setup and pass credentials via the GRPCConnector constructor options.
Ensure you create a new instance: const connector = new GRPCConnector({ host: 'localhost', port: 50051 });Start the server first, and verify the client uses the same host and port as the server.
Check the service object keys and verify the exact name used in call(). Ensure the server has published the service.