npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@connectum/reflection

v1.0.0-rc.5

Published

gRPC Server Reflection protocol for Connectum (v1 + v1alpha)

Downloads

522

Readme

@connectum/reflection

gRPC Server Reflection protocol for Connectum.

@connectum/reflection implements the gRPC Server Reflection Protocol (v1 + v1alpha) as a Connectum protocol plugin. Allows clients like grpcurl, Postman, and buf curl to discover services, methods, and message types at runtime without requiring proto files.

Features

  • gRPC Server Reflection v1 + v1alpha: Full protocol support via @lambdalisue/connectrpc-grpcreflect
  • Zero Configuration: No arguments required, works out of the box
  • Automatic Descriptor Collection: Recursively collects all proto file descriptors with transitive dependencies
  • Client Compatibility: Works with grpcurl, Postman, buf curl, and any gRPC reflection-aware client

Installation

pnpm add @connectum/reflection

Peer dependency:

pnpm add @connectum/core

Quick Start

import { createServer } from '@connectum/core';
import { Reflection } from '@connectum/reflection';
import routes from '#gen/routes.js';

const server = createServer({
  services: [routes],
  port: 5000,
  protocols: [Reflection()],
});

await server.start();

// Clients can now discover services via gRPC Server Reflection

API

Reflection()

Factory function that creates a ProtocolRegistration for the gRPC Server Reflection protocol.

import { Reflection } from '@connectum/reflection';

function Reflection(): ProtocolRegistration;

The function takes no arguments. It automatically collects all registered service file descriptors from the ProtocolContext and builds a FileDescriptorSet for the reflection service.

Pass the result to createServer({ protocols: [...] }).

collectFileProtos(files)

Utility function that recursively collects FileDescriptorProto objects from DescFile entries, including transitive dependencies. Deduplicates by file name using depth-first traversal.

import { collectFileProtos } from '@connectum/reflection';
import type { DescFile } from '@bufbuild/protobuf';

function collectFileProtos(files: ReadonlyArray<DescFile>): DescFile['proto'][];

This is primarily used internally by Reflection() but is exported for advanced use cases where you need direct access to file descriptors.

How It Works

When the server starts, the Reflection protocol:

  1. Receives all registered service file descriptors via ProtocolContext.registry
  2. Recursively collects all proto file descriptors and their dependencies using collectFileProtos()
  3. Builds a FileDescriptorSet from the collected protos
  4. Registers the ServerReflection service (v1 and v1alpha) on the ConnectRouter via registerServerReflectionFromFileDescriptorSet

Usage with grpcurl

grpcurl is the most common client for gRPC Server Reflection:

# List all services
grpcurl -plaintext localhost:5000 list

# Describe a service
grpcurl -plaintext localhost:5000 describe my.service.v1.MyService

# Describe a method
grpcurl -plaintext localhost:5000 describe my.service.v1.MyService.GetUser

# Call a method (reflection provides the schema)
grpcurl -plaintext -d '{"id": "123"}' \
  localhost:5000 my.service.v1.MyService/GetUser

Usage with buf curl

# List services
buf curl --protocol grpc --http2-prior-knowledge http://localhost:5000 --list-methods

# Call a method
buf curl --protocol grpc --http2-prior-knowledge \
  -d '{"id": "123"}' \
  http://localhost:5000/my.service.v1.MyService/GetUser

Combined with Healthcheck

Reflection and Healthcheck are typically used together:

import { createServer } from '@connectum/core';
import { Healthcheck, healthcheckManager, ServingStatus } from '@connectum/healthcheck';
import { Reflection } from '@connectum/reflection';
import routes from '#gen/routes.js';

const server = createServer({
  services: [routes],
  port: 5000,
  protocols: [
    Healthcheck({ httpEnabled: true }),
    Reflection(),
  ],
  shutdown: { autoShutdown: true },
});

server.on('ready', () => {
  healthcheckManager.update(ServingStatus.SERVING);
});

await server.start();

Exports Summary

| Export | Description | |--------|-------------| | Reflection | Protocol registration factory | | collectFileProtos | Utility to collect file descriptors with dependencies |

Dependencies

Peer Dependencies

  • @connectum/core -- Server factory and ProtocolRegistration types

Dependencies

  • @bufbuild/protobuf -- Protocol Buffers runtime
  • @connectrpc/connect -- ConnectRPC core
  • @lambdalisue/connectrpc-grpcreflect -- gRPC Server Reflection implementation

Requirements

  • Node.js: >=25.2.0 (for stable type stripping)
  • pnpm: >=10.0.0

License

Apache-2.0


Part of @connectum -- Universal framework for production-ready gRPC/ConnectRPC microservices