{"id":48068,"library":"grpc-reflection-js","title":"grpc-reflection-js","description":"A JavaScript library for querying gRPC server reflection protocol, allowing dynamic discovery of gRPC services and protobuf definitions at runtime. Version 0.3.0 is the latest stable release, with moderate release cadence. It simplifies interaction with gRPC servers that implement the reflection protocol by providing methods to list services, retrieve file descriptors by symbol or filename. Unlike alternatives like protobuf.js, it focuses solely on reflection, using the @grpc/grpc-js package for gRPC communication. The library ships TypeScript types for enhanced developer experience.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/redhoyasa/grpc-reflection-js","tags":["javascript","grpc","gRPC","typescript"],"install":[{"cmd":"npm install grpc-reflection-js","lang":"bash","label":"npm"},{"cmd":"yarn add grpc-reflection-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add grpc-reflection-js","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for gRPC channel and credentials","package":"@grpc/grpc-js","optional":false}],"imports":[{"note":"ESM and TypeScript: named export. CommonJS: destructure require.","wrong":"const Client = require('grpc-reflection-js').Client;","symbol":"Client","correct":"import { Client } from 'grpc-reflection-js';"},{"note":"Use @grpc/grpc-js, not the deprecated grpc package. ESM or CJS.","wrong":"const grpc = require('grpc');","symbol":"grpc","correct":"import * as grpc from '@grpc/grpc-js';"},{"note":"Exists as default export for convenience, but named Client is typical.","wrong":"const grpcReflection = require('grpc-reflection-js');","symbol":"default import","correct":"import grpcReflection from 'grpc-reflection-js';"}],"quickstart":{"code":"import { Client } from 'grpc-reflection-js';\nimport * as grpc from '@grpc/grpc-js';\n\nconst serverAddress = 'localhost:50051';\nconst client = new Client(serverAddress, grpc.credentials.createInsecure());\n\nasync function listServices() {\n  try {\n    const services = await client.listServices();\n    console.log('Services:', services);\n  } catch (err) {\n    console.error('Error:', err.message);\n  }\n}\n\nlistServices();","lang":"typescript","description":"Initialize a reflection client and list all gRPC services exposed by the server."},"warnings":[{"fix":"npm install @grpc/grpc-js@^1.0.0","message":"Requires @grpc/grpc-js v1.0+, not the older 'grpc' package.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Use async/await or .then() instead of callbacks.","message":"The API uses callbacks in older examples; current version returns Promises.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Verify server supports reflection by checking its gRPC reflection service.","message":"Server must implement gRPC reflection protocol v1alpha; otherwise listServices returns empty.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.3.0':26 'allow':14 'altern':61 'cadenc':35 'communic':75 'definit':22 'descriptor':55 'develop':83 'discoveri':16 'dynam':15 'enhanc':82 'experi':84 'file':54 'filenam':59 'focus':65 'grpc':2,10,18,40,74,86,87 'grpc-reflection-j':1 'grpc/grpc-js':71 'implement':43 'interact':38 'javascript':6,85 'js':4 'latest':29 'librari':7,77 'like':62 'list':51 'method':49 'moder':33 'packag':72 'protobuf':21 'protobuf.js':63 'protocol':13,46 'provid':48 'queri':9 'reflect':3,12,45,68 'releas':31,34 'retriev':53 'runtim':24 'server':11,41 'servic':19,52 'ship':78 'simplifi':37 'sole':66 'stabl':30 'symbol':57 'type':80 'typescript':79,88 'unlik':60 'use':69 'version':25","created_at":"2026-06-07T16:54:45.938979+00:00","updated_at":"2026-06-07T16:54:45.938979+00:00","problems":[{"fix":"npm install @grpc/grpc-js","cause":"Missing peer dependency @grpc/grpc-js or using deprecated 'grpc' package","error":"Error: Cannot find module 'grpc'"},{"fix":"Import from '@grpc/grpc-js' and use appropriate credential methods","cause":"Using the deprecated 'grpc' package instead of @grpc/grpc-js","error":"TypeError: grpc.credentials.createInsecure is not a function"},{"fix":"Ensure the server implements grpc.reflection.v1alpha.ServerReflection service","cause":"Server does not support reflection or incorrect address","error":"Error: 12 UNIMPLEMENTED: Method not found"}],"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/redhoyasa/grpc-reflection-js#readme","github":"https://github.com/redhoyasa/grpc-reflection-js","docs":null,"changelog":null,"pypi":null,"npm":"grpc-reflection-js","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}}