{"id":48186,"library":"io-grpc","title":"io-grpc","description":"A lightweight RPC framework built on gRPC for Node.js, providing a simplified API for creating services and clients with streaming support. Current version is 0.3.2. It wraps gRPC with a middleware pattern, TLS support, and a route-based approach for defining RPC handlers. Differentiators include a minimal API surface and built-in middleware similar to Express, but the package is in early development with sparse documentation and no TypeScript support.","status":"active","version":"0.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/xuezier/io-grpc","tags":["javascript","grpc","io","connect","comminute"],"install":[{"cmd":"npm install io-grpc","lang":"bash","label":"npm"},{"cmd":"yarn add io-grpc","lang":"bash","label":"yarn"},{"cmd":"pnpm add io-grpc","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core gRPC library used for underlying RPC communication","package":"grpc","optional":false}],"imports":[{"note":"Package exports an object, not a single function. Must destructure to get createServiceRpc.","wrong":"const createServiceRpc = require('io-grpc')","symbol":"createServiceRpc","correct":"const { createServiceRpc } = require('io-grpc')"},{"note":"While the above works, destructuring is cleaner. The package is CommonJS only.","wrong":"const createClient = require('io-grpc').createClientRpc","symbol":"createClientRpc","correct":"const { createClientRpc } = require('io-grpc')"}],"quickstart":{"code":"const { createServiceRpc, createClientRpc } = require('io-grpc');\n\n// Server\nconst serviceRpc = createServiceRpc();\nconst route = serviceRpc.load('./api.proto').Route;\nserviceRpc.addService('Chat', (call) => {\n  console.log(call.body);\n  call.write({ content: 'response' });\n});\nserviceRpc.decorate(route);\nserviceRpc.bind('0.0.0.0:50051');\nconsole.log('Server running on port 50051');\n\n// Client\nconst clientRpc = createClientRpc();\nconst clientRoute = clientRpc.load('./api.proto').Route;\nclientRpc.decorate(clientRoute, 'localhost:50051');\nclientRpc.route('Chat', { content: 'hello' }, (call) => {\n  console.log('Response:', call.body);\n});","lang":"javascript","description":"Demonstrates how to create a gRPC service and client using io-grpc, including loading a protobuf file, adding a service handler, and making an RPC call."},"warnings":[{"fix":"Pin to a specific version and test thoroughly before upgrading.","message":"The package is in early development (v0.3.2). API may change without notice. No stable release yet.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use destructured require: const { createServiceRpc } = require('io-grpc');","message":"The package does not export named exports as documented; it exports an object with createServiceRpc and createClientRpc. Using wrong import pattern breaks the application.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure the string passed to addService/route matches the full service name including package, e.g., 'route.Chat'.","message":"Protobuf service names used in addService and route must match exactly the package and service name from the proto file (e.g., 'route.Chat'). Incorrect naming causes 'Method not found' errors.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use require() syntax; consider wrapping in a dynamic import if needed for ESM projects.","message":"The package does not support ESM. Using import statements will fail.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.3.2':28 'api':16,52 'approach':43 'base':42 'built':8,56 'built-in':55 'client':21 'comminut':80 'connect':79 'creat':18 'current':25 'defin':45 'develop':68 'differenti':48 'document':71 'earli':67 'express':61 'framework':7 'grpc':3,10,31,77 'handler':47 'includ':49 'io':2,78 'io-grpc':1 'javascript':76 'lightweight':5 'middlewar':34,58 'minim':51 'node.js':12 'packag':64 'pattern':35 'provid':13 'rout':41 'route-bas':40 'rpc':6,46 'servic':19 'similar':59 'simplifi':15 'spars':70 'stream':23 'support':24,37,75 'surfac':53 'tls':36 'typescript':74 'version':26 'wrap':30","created_at":"2026-06-07T16:55:20.603278+00:00","updated_at":"2026-06-07T16:55:20.603278+00:00","problems":[{"fix":"const { createServiceRpc } = require('io-grpc');","cause":"Importing the package incorrectly (e.g., const createServiceRpc = require('io-grpc'))","error":"TypeError: createServiceRpc is not a function"},{"fix":"Use the full service name as defined in the proto file, e.g., 'route.Chat'","cause":"Incorrect service name format used in addService or route calls","error":"Error: Method not found: Route/Chat"},{"fix":"npm install grpc","cause":"grpc peer dependency not installed","error":"Error: Cannot find module 'grpc'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/xuezier/io-grpc#readme","github":"https://github.com/xuezier/io-grpc","docs":null,"changelog":null,"pypi":null,"npm":"io-grpc","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}