This package provides an implementation of gRPC Server Reflection for Node.js applications, specifically designed to work with the `@grpc/grpc-js` library. It enables gRPC clients, such as `grpccurl` or `Postman`, to dynamically discover the services, methods, and message types exposed by a gRPC server at runtime, without needing pre-compiled `.proto` files on the client side. The current stable version is 1.0.2. As a utility library, its release cadence is primarily driven by updates to its core dependency, `@grpc/grpc-js`, or bug fixes, rather than a fixed schedule. Its key differentiator is its straightforward integration method, requiring only a single function call to wrap an existing `@grpc/grpc-js` server instance, thereby abstracting the complex details of implementing the `grpc.reflection.v1alpha.ServerReflection` service manually. Currently, it fully supports `ListServices` and `FileContainingSymbol` requests but explicitly notes that `FileByFilename` and `FileContainingExtension` requests are not yet implemented.
npm install grpc-node-server-reflectionVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to integrate server reflection into an existing `@grpc/grpc-js` server instance, ensuring services are discoverable via tools like `grpcurl`.
Always ensure you call `wrapServerWithReflection(yourServerInstance)` on your `grpc.Server` instance *before* adding any application-specific services using `yourServerInstance.addService(...)`.
Clients should avoid sending `FileByFilename` or `FileContainingExtension` requests. Consult the package documentation for the supported reflection request types (`ListServices`, `FileContainingSymbol`).
Verify that `wrapServerWithReflection` has been successfully called on your `grpc.Server` instance. Also, confirm that your gRPC server is properly started and listening on the expected port.
Reorder your server initialization. Call `wrapServerWithReflection(server)` first, then use the returned (wrapped) server object (`reflectedServer.addService(...)`) to register your application's services.