{"id":48627,"library":"multi-proto-grpc-server","title":"multi-proto-grpc-server","description":"Wrapper around the official grpc npm package that simplifies handling multiple proto files for various gRPC clients communicating with a single server. Version 3.0.0 supports Node 8.0+ and provides a ServiceMap class to bind service implementations and a GRPC class to start the server on a given address. It differentiates from raw gRPC by offering a declarative configuration for multiple services and proto files. Release cadence is not specified; the package appears to be in early development with upcoming features like authentication.","status":"active","version":"3.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/krisalay/multi-proto-grpc-server","tags":["javascript","gRPC","RPC","grpc","rpc"],"install":[{"cmd":"npm install multi-proto-grpc-server","lang":"bash","label":"npm"},{"cmd":"yarn add multi-proto-grpc-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add multi-proto-grpc-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core gRPC library for Node.js","package":"grpc","optional":false}],"imports":[{"note":"CommonJS destructuring works with require; ESM import syntax is recommended for modern code.","wrong":"const GRPC = require('multi-proto-grpc-server').GRPC","symbol":"GRPC","correct":"import { GRPC } from 'multi-proto-grpc-server'"},{"note":"Named export; common mistake is to import as default.","wrong":"const { ServiceMap } = require('multi-proto-grpc-server')","symbol":"ServiceMap","correct":"import { ServiceMap } from 'multi-proto-grpc-server'"},{"note":"GRPC must be instantiated with new before calling run().","wrong":"GRPC(configs).run('0.0.0.0:50051')","symbol":"GRPC class instance","correct":"const server = new GRPC(configs); server.run('0.0.0.0:50051');"}],"quickstart":{"code":"const { GRPC, ServiceMap } = require('multi-proto-grpc-server');\n\n// Define service implementations as objects with methods matching RPC names\nconst notificationService = {\n  send: (call, callback) => {\n    callback(null, { response: 'Notification sent' });\n  }\n};\n\n// Create a ServiceMap for each proto package\nconst notificationServiceMap = new ServiceMap('notification', notificationService);\n\n// Configuration array for each proto file\nconst server = new GRPC([\n  {\n    packageName: 'notification',\n    serviceName: 'Notification',\n    PROTO_PATH: './notification.proto',\n    serviceMap: notificationServiceMap.map\n  }\n]);\n\n// Start the server\nserver.run('0.0.0.0:50051');","lang":"javascript","description":"Demonstrates creating a gRPC server with a single proto service using ServiceMap and GRPC classes."},"warnings":[{"fix":"Migrate to '@grpc/grpc-js' and use its server implementation directly, or ensure that the 'grpc' module works in your environment.","message":"The package uses the deprecated 'grpc' module, which has been superseded by '@grpc/grpc-js'. The 'grpc' module is no longer maintained and may have compatibility issues with newer Node versions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use path.resolve(__dirname, './notification.proto') to ensure correct path resolution.","message":"The PROTO_PATH must be an absolute or relative path to the .proto file. Relative paths are resolved from the current working directory, which may differ from the script location.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Verify the 'package' line in the proto file and use the exact same string.","message":"The ServiceMap constructor requires the package name exactly as declared in the proto file's 'package' statement, including case sensitivity. Mismatches cause silent failures.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always use ServiceMap instance's map property (e.g., serviceMap: myServiceMap.map).","message":"The serviceMap property passed to GRPC config must be obtained from ServiceMap.map. Directly passing a plain object may lead to undefined behavior.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Ensure all .proto files start with 'syntax = \"proto3\";'.","message":"The proto file syntax must be proto3; proto2 is not supported and will cause errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'3.0.0':29 '8.0':32 'address':53 'appear':77 'around':7 'authent':87 'bind':39 'cadenc':71 'class':37,45 'client':22 'communic':23 'configur':63 'declar':62 'develop':82 'differenti':55 'earli':81 'featur':85 'file':18,69 'given':52 'grpc':4,10,21,44,58,89,91 'handl':15 'implement':41 'javascript':88 'like':86 'multi':2 'multi-proto-grpc-serv':1 'multipl':16,65 'node':31 'npm':11 'offer':60 'offici':9 'packag':12,76 'proto':3,17,68 'provid':34 'raw':57 'releas':70 'rpc':90,92 'server':5,27,49 'servic':40,66 'servicemap':36 'simplifi':14 'singl':26 'specifi':74 'start':47 'support':30 'upcom':84 'various':20 'version':28 'wrapper':6","created_at":"2026-06-07T16:57:36.352502+00:00","updated_at":"2026-06-07T16:57:36.352502+00:00","problems":[{"fix":"Run 'npm install grpc' in your project.","cause":"The 'grpc' package is not installed as a direct dependency; it is a peer dependency that must be installed separately.","error":"Error: Cannot find module 'grpc'"},{"fix":"Use: const { ServiceMap } = require('multi-proto-grpc-server');","cause":"ServiceMap is imported incorrectly, e.g., as a default import instead of named import.","error":"TypeError: ServiceMap is not a constructor"},{"fix":"Use path.resolve(__dirname, './notification.proto') to provide an absolute path.","cause":"The PROTO_PATH is a relative path that does not exist relative to the current working directory.","error":"Error: ENOENT: no such file or directory, open './notification.proto'"},{"fix":"Use: const server = new GRPC(configs); server.run(address);","cause":"GRPC was not instantiated with 'new', so run() is undefined.","error":"TypeError: server.run is not a function"}],"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/krisalay/multi-proto-grpc-server#readme","github":"https://github.com/krisalay/multi-proto-grpc-server","docs":null,"changelog":null,"pypi":null,"npm":"multi-proto-grpc-server","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"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}}