JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 423
  • Score
    100M100P100Q112219F
  • License MIT

Schema-driven binary serialization for TypeScript - Protobuf-style encoding compiled from @coderbuzz/veta validators.

Package Exports

  • @coderbuzz/proto

Readme

Proto — @coderbuzz/proto

Binary serialization for TypeScript. Smaller than Protobuf. No .proto files. Zero per-field overhead.

Compiles high-performance binary codecs from @coderbuzz/veta schema validators at runtime. No field names, no type tags, no per-field headers — just pure payload data.

Why Proto Over Standard Protobuf?

  • No .proto files — schemas are TypeScript validators from @coderbuzz/veta
  • Zero per-field overhead — Protobuf adds tag + wire type per field; Proto adds nothing
  • Smaller than MessagePack — no type tags on every value
  • size() pre-calculation — exact byte count without encoding
  • Literals are 0 bytes — value known from schema
  • Unions in 1 byte — variant index prefix instead of Protobuf's oneof wrapper

Installation

npm install @coderbuzz/proto @coderbuzz/veta

Quick Start

import { proto } from "@coderbuzz/proto";
import { object, string, number } from "@coderbuzz/veta";

const User = object({ name: string(), age: number() });
const codec = proto(User);

const bytes = codec.encode({ name: "Alice", age: 30 });
// Binary — no field names, no tags, just payload

const user = codec.decode(bytes);
// => { name: "Alice", age: 30 }

Documentation

Full API reference, wire format details, and type reference: DOCS.md

License

MIT © 2026 Indra Gunawan