@trendvidia/protowire
v1.2.0
Published
TypeScript port of protowire — PXF text format, SBE binary, struct-tag protobuf, and API response envelope. Verified for byte-equivalence with the canonical Go reference and seven other sibling ports.
Maintainers
Readme
protowire-typescript
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/protowireimport { parse } from "@trendvidia/protowire/pxf"; // ESM
// or:
const { parse } = require("@trendvidia/protowire/pxf"); // CJSAll 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 Goencoding/pbpackage'sprotowire:"N"struct tags).@trendvidia/protowire/pxf— PXF (Proto eXpressive Format) text codec. Schema-bound encoder/decoder overprotobuf-esdescriptors.@trendvidia/protowire/sbe— SBE (Simple Binary Encoding) codec, driven bysbe.*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@latestTypeScript 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