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

@dcsv-io/d2-protos

v0.1.2

Published

<!-- Copyright (c) DCSV. Licensed under the Apache License, Version 2.0. -->

Readme

@dcsv-io/d2-protos

Buf-generated TS modules + gRPC client stubs from contracts/protos/. Mirrors DcsvIo.D2.Protos (.NET — generated via Grpc.Tools at csproj build time).

Install

pnpm add @dcsv-io/d2-protos

Public API

The package re-exports every generated module under src/generated/. The generation workflow (Buf + ts-proto) runs via pnpm generate and writes output that is committed to git so consumers don't need to run codegen on first build. Each contracts/protos/{namespace}/v1/*.proto file auto-generates into src/generated/{namespace}/v1/{name}.ts via the build's generate step.

Current re-exports from src/index.ts:

| Export | Source file | Purpose | | ------------------- | --------------------------------------- | ------------------------------------------------------------------------- | | D2ResultProto | generated/common/v1/d2_result.ts | Full D2Result wire envelope (success, status, errorCode, category, …). | | TKMessageProto | generated/common/v1/d2_result.ts | Translation-key message with map<string,string> params. | | InputErrorProto | generated/common/v1/d2_result.ts | Field-level validation error: field name + TKMessageProto[] errors. |

The codec (d2ResultToProto / d2ResultFromProto / handleGrpcCall) that converts between D2Result and D2ResultProto is host-supplied, not here — this package is the generated-stub layer only.

Dependencies

  • @bufbuild/protobuf — runtime types for proto-generated code.
  • @grpc/grpc-js — gRPC client transport.
  • @bufbuild/buf (devDep) — codegen tooling.
  • ts-proto (devDep) — protoc plugin emitting TS.

Generation workflow

pnpm --filter @dcsv-io/d2-protos generate

buf.gen.yaml configures ts-proto with these options: esModuleInterop=true, outputServices=grpc-js, useExactTypes=false, oneof=unions, useOptionals=messages. Output is per-file under src/generated/{namespace}/v1/{name}.ts.

Parity with .NET

Every .proto file generates into BOTH:

  • .NET: DcsvIo.D2.Protos (via Grpc.Tools + csproj <Protobuf Include>)
  • TS: @dcsv-io/d2-protos/src/generated/... (via Buf + ts-proto)

The contracts/protos/ directory is the single source of truth — neither side hand-writes proto modules.

Edge cases

  • Codegen idempotency: re-running pnpm generate produces zero diff if no .proto changes. Spec drift surfaces in PR review.
  • Generated code is committed to git so consumers don't pay a generate-on-first-build penalty.
  • Generated code is excluded from coverage thresholds and from ESLint formatting (lives in src/generated/).