# stephenh/ts-proto

An idiomatic protobuf generator for TypeScript

Repository: https://github.com/stephenh/ts-proto
Canonical: https://ross.abutalabs.com/products/ts-proto
Language: TypeScript
License: Apache-2.0
License Family: permissive
Topics: protobuf, typescript, nestjs, twirp, dataloader, grpc, grpc-node, grpc-web
Last push: 2026-08-20T19:58:28+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 98, longevity 100
- inputs: {"age_days": 2775, "days_push": 13, "days_rel": 13, "gap_med": 6.0, "n_releases_24m": 45}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2590, forks 391 (observed 2026-08-28T04:07:02.907841+00:00)

## What it is
ts-proto is a protoc plugin that generates idiomatic, strongly-typed TypeScript code from protobuf schema files, including encode/decode methods and service types. It supports gRPC, Twirp, and NestJS integrations and uses @bufbuild/protobuf for low-level wire serialization in its 2.x releases.

## Use cases
- generate TypeScript types from .proto files
- serialize and deserialize protobuf messages in TypeScript
- create typed gRPC clients and servers in TypeScript
- use protobuf schemas with NestJS
- prevent N+1 queries with auto-batching via dataloader
- integrate protobuf with Buf build tooling
- work with Twirp services in TypeScript

## When to choose
- you want idiomatic TypeScript interfaces instead of protobufjs classes
- your stack is TypeScript/Node with gRPC, Twirp, or NestJS
- you use Buf and want a well-supported protobuf-to-TS plugin
- you need strongly-typed encode/decode and JSON conversion for proto messages

## When to avoid
- you need runtime reflection or dynamic message handling rather than generated code
- you cannot adopt @bufbuild/protobuf and must stay on protobufjs primitives (use ts-proto 1.x)
- you are not using TypeScript or a protobuf-based workflow
- you prefer official first-party tooling like @bufbuild/protoc-gen-es

## Facets
- artifact type: library
- maturity: active
- function: serialization, developer-tools
- domain: developer-tools, apis, web-development, backend
- platform: cross-platform
- tags: protobuf, grpc, twirp, nestjs, dataloader, grpc-web, buf, schema-codegen, code-generation, nodejs, typescript

## Member repositories
- stephenh/ts-proto (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:02.907841+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:22:20.945563+00:00, confidence not recorded.
  - readme: https://github.com/stephenh/ts-proto (fetched 2026-08-28T04:07:02.907841+00:00, sha 44f92fb7db3e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
