Skip to content

trendvidia/protowire-typescript

Repository files navigation

protowire-typescript

License: MIT npm CI

TypeScript port of protowire — a wire-format toolkit. Pure TypeScript on top of @bufbuild/protobuf, no WASM. Verified for byte-equivalence with the canonical Go reference and seven other sibling ports.

Ships dual ESM + CJS so the package works under modern bundlers (Vite, esbuild, webpack 5+, rollup) and legacy CommonJS Node.js consumers alike. Releases are signed via npm provenance; verify with npm audit signatures.

Install

npm install @trendvidia/protowire
import { parse } from "@trendvidia/protowire/pxf";   // ESM
// or:
const { parse } = require("@trendvidia/protowire/pxf");  // CJS

All published artifacts share the 0.70.x line; ports at the same minor implement the same wire contract.

Modules

  • @trendvidia/protowire/envelope — API response envelope (OK, Err, TransportErr, AppError, FieldError).
  • @trendvidia/protowire/pb — schema-free protobuf binary marshaling driven by a TypeScript field-tag schema (mirrors the Go encoding/pb package's protowire:"N" struct tags).
  • @trendvidia/protowire/pxf — PXF (Proto eXpressive Format) text codec. Schema-bound encoder/decoder over protobuf-es descriptors.
  • @trendvidia/protowire/sbe — SBE (Simple Binary Encoding) codec, driven by sbe.* annotations on proto schemas.

See the spec repo for the format reference.

Command-line tool

The protowire CLI is shared across every port and lives in the spec repo at github.com/trendvidia/protowire/cmd/protowire. Install:

go install github.com/trendvidia/protowire/cmd/protowire@latest

TypeScript users use this library for in-process encode/decode and the shared CLI for command-line operations. There is no separate TypeScript CLI binary.

Development

npm install
npm test
npm run typecheck
npm run build

About

Typescript port of trendvidia/protowire - a serialization toolkit built around PXF (Proto eXpressive Format), SBE (Simple Binary Encoding), and a cross-port Envelope. PXF is a human-friendly text serialization format backed by protobuf schemas; SBE is a fixed-offset binary format for ultra-low-latency workloads; both share the same .proto file.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors