qmetrics.net

protobuf.js

Protocol Buffers runtime for JavaScript and TypeScript

A JavaScript and TypeScript implementation of Protocol Buffers for Node.js and browsers. Load .proto schemas, encode and decode binary messages, and optionally generate static or reflection-based code.

Overview

protobuf.js implements Google Protocol Buffers for JavaScript and TypeScript environments, including Node.js and browsers. It can work from .proto schema files without requiring the protoc compiler, and supports both runtime reflection and ahead-of-time code generation with matching TypeScript declarations.

Typical use starts with installing the package, loading a schema, then encoding and decoding messages. Message types expose validation, conversion between plain JavaScript objects and binary wire format, and length-delimited framing for streams. Field names from .proto files are converted to camelCase by default, with an option to keep original casing.

Optional tooling generates schema-specific modules in reflection or static modes, both sharing the same runtime package. A companion CLI can build reflection bundles, static code, and TypeScript declarations without protoc, or work alongside protoc via a plugin. Browser builds are available through a CDN with CommonJS, AMD, and global exports.

Beyond core binary APIs, extensions can handle ProtoJSON, text format, and descriptor conversion when reflection metadata is present. Service definitions support transport-agnostic RPC clients. The implementation is checked against the official conformance suite for Proto2, Proto3, and Editions wire formats, with optional coverage for text and JSON formats.

Key features

  • .proto loading without protoc
  • Reflection and static code generation
  • TypeScript declarations from CLI
  • Browser and Node.js runtimes
  • Transport-agnostic service clients
  • Plain object conversion options
  • ProtoJSON and text format extensions
  • Length-delimited message encoding

Use cases

  • Binary API message serialization
  • Shared schemas across JS services
  • Browser clients using protobuf wire format
  • gRPC-style services with custom transport
  • Schema-driven TypeScript APIs

Tags

Similar software

FastAPI

Python web framework for building APIs with type hints

FastAPI is a Python web framework for building APIs using standard type hints. It builds on Starlette and Pydantic and generates interactive OpenAPI documentation for the endpoints you define.

★ 105.1k⟳ 9 days agoMIT

NestJS

Progressive TypeScript framework for Node.js backends

Nest organizes Node server apps with modules, dependency injection, and first-party packages for auth, data, queues, and observability.

★ 77.2k⟳ todayMIT

OkHttp

HTTP client for JVM, Android, and GraalVM

OkHttp is an HTTP client library tuned for efficient networking on Android, Java, and GraalVM native images. It offers synchronous and asynchronous call APIs with a fluent request builder.

★ 47.1k⟳ yesterdayApache-2.0
Frameworks & PlatformsDesktop/CLI app

gRPC

Cross-language remote procedure call framework

gRPC is an RPC framework that lets client and server programs communicate transparently and supports building connected, multi-language systems.

★ 45.5k⟳ todayApache-2.0

tRPC

End-to-end typesafe TypeScript APIs without code generation

tRPC helps teams define server procedures and call them from clients with full TypeScript types for inputs, outputs, and errors—no schemas or codegen step.

★ 40.9k⟳ todayMIT
Frameworks & PlatformsDesktop/CLI app

go-zero

Cloud-native Go microservices and RPC framework

go-zero is a Go web and RPC framework with code generation, built-in resilience middleware, and tooling aimed at stable high-traffic services.

★ 33.5k⟳ 9 days agoMIT