{"id":48021,"library":"grpc-generated-name","title":"grpc-generated-name","description":"A library containing gRPC-generated TypeScript/JavaScript code and types for client-server communication. Current stable version 0.0.21 is pre-release and likely unstable. Use it with a gRPC server implementation (e.g., @grpc/grpc-js). Key differentiators: auto-generated from your .proto files, includes TypeScript types compiled from proto definitions. Alternative: use protobuf-ts or manually define types.","status":"active","version":"0.0.21","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install grpc-generated-name","lang":"bash","label":"npm"},{"cmd":"yarn add grpc-generated-name","lang":"bash","label":"yarn"},{"cmd":"pnpm add grpc-generated-name","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required at runtime for gRPC client and server functionality.","package":"@grpc/grpc-js","optional":false}],"imports":[{"note":"ServiceClient is a named export, not default. Check your generated exports if this package exports differently.","wrong":"import ServiceClient from 'grpc-generated-name'","symbol":"ServiceClient","correct":"import { ServiceClient } from 'grpc-generated-name'"},{"note":"Works in CommonJS but avoid mixing module systems. This package is ESM-only by default; use dynamic import or set type: module.","wrong":"const ServiceServer = require('grpc-generated-name').ServiceServer","symbol":"ServiceServer","correct":"import { ServiceServer } from 'grpc-generated-name'"},{"note":"TypeScript types are exported alongside runtime values. No wrong pattern common.","wrong":"","symbol":"MessageType","correct":"import { MessageType } from 'grpc-generated-name'"},{"note":"The definitions subpath export is available since v0.0.18. Direct import from root may not include full proto definition.","wrong":"import { protoPackage } from 'grpc-generated-name'","symbol":"protoPackage","correct":"import { protoPackage } from 'grpc-generated-name/definitions'"}],"quickstart":{"code":"import { protobufPackage, ServiceClient, createChannel, createClientFactory } from 'grpc-generated-name';\nimport { ChannelCredentials } from '@grpc/grpc-js';\n\nconst channel = createChannel('localhost:50051', ChannelCredentials.createInsecure());\nconst client = createClientFactory().use(ServiceClient).create(channel);\n\nclient.unaryCall({ name: 'World' }, (err, response) => {\n  if (err) console.error(err);\n  else console.log(response.message);\n});","lang":"typescript","description":"Creates a gRPC client using generated code and calls a unary RPC named 'unaryCall' assuming it exists in your proto. Replace with actual method names."},"warnings":[{"fix":"Update imports to use 'from \\\"pkg/generated\\\"' if needed, or check package.json exports field.","message":"Export paths changed in v0.0.18: previously exported from root, now nested under 'generated/' subpath","severity":"breaking","affected_versions":">=0.0.18"},{"fix":"Replace `createServer` with `createServiceServer`.","message":"The function `createServer` is deprecated in favor of `createServiceServer` since v0.0.15.","severity":"deprecated","affected_versions":">=0.0.15"},{"fix":"Use generated type guards or runtime enum mappers from '@grpc/grpc-js'.","message":"TypeScript types are exported, but some numeric enum values may be strings in JavaScript. Check gRPC enum behavior.","severity":"gotcha","affected_versions":"*"},{"fix":"Upgrade Node.js or pin to v0.0.19 if stuck on older Node.","message":"Node.js >= 14 required starting v0.0.20 due to native ESM features.","severity":"breaking","affected_versions":">=0.0.20"}],"env_vars":null,"search_vec":"'0.0.21':23 'altern':56 'auto':43 'auto-gener':42 'client':17 'client-serv':16 'code':12 'communic':19 'compil':52 'contain':7 'current':20 'defin':63 'definit':55 'differenti':41 'e.g':38 'file':48 'generat':3,10,44 'grpc':2,9,35 'grpc-gener':8 'grpc-generated-nam':1 'grpc/grpc-js':39 'implement':37 'includ':49 'javascript':65 'key':40 'librari':6 'like':29 'manual':62 'name':4 'pre':26 'pre-releas':25 'proto':47,54 'protobuf':59 'protobuf-t':58 'releas':27 'server':18,36 'stabl':21 'ts':60 'type':14,51,64 'typescript':50,66 'typescript/javascript':11 'unstabl':30 'use':31,57 'version':22","created_at":"2026-06-07T16:54:31.720489+00:00","updated_at":"2026-06-07T16:54:31.720489+00:00","problems":[{"fix":"Run `npm install grpc-generated-name@0.0.21` and verify package.json.","cause":"Package not installed or typo in package name.","error":"Error: Cannot find module 'grpc-generated-name'"},{"fix":"Use `import { ServiceClient } from 'grpc-generated-name'` instead of `import ServiceClient from ...`.","cause":"Improper import: using default import instead of named import.","error":"TypeError: ServiceClient is not a constructor"},{"fix":"Ensure proto methods match generated exports. Check server endpoint and import correct service definition.","cause":"Trying to call a method that exists in proto but not in generated code, or wrong server address.","error":"gRPC error: UNIMPLEMENTED (12): Method not found"},{"fix":"Use generated code from this package directly; avoid manual proto loading.","cause":"Using deprecated gRPC loading function; not directly related to this package but common confusion.","error":"DeprecationWarning: grpc.load is deprecated, use @grpc/proto-loader"}],"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":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"grpc-generated-name","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}}