Home > Engineering > Infrastructure > bare-for-pear > avsc
avsc — Avro Type System
Reference for avsc — a complete pure JavaScript implementation of the Apache Avro specification, forked and adapted for the Bare runtime.
What avsc Is
avsc is a complete implementation of the Apache Avro specification in pure JavaScript. Types, serialization, schema evolution, container files, IDL parsing — the full specification surface in a single library.
Forked from mtth/avsc and barified for the Bare runtime.
Source: github.com/bare-for-pear/avsc Upstream: github.com/mtth/avsc
What the Fork Changes
The fork replaces Node.js built-in modules with Bare equivalents. The Avro API is unchanged.
| Concern | Upstream | Fork |
|---|---|---|
| Crypto | crypto |
bare-crypto |
| Filesystem | fs |
bare-fs |
| Path | path |
bare-path |
| Streams | stream |
bare-stream |
Additional adaptations:
- TextEncoder/TextDecoder polyfill — Bare’s
text-decoder uses a streaming API. avsc expects the
WHATWG standard
.decode()and.encodeInto(). The polyfill bridges this. - Buffer/Uint8Array bridging — conditional handling where Bare’s buffer semantics differ from Node’s global Buffer.
- Bare-only targeting — the upstream dual-runtime support (Node.js + browser) is removed. One runtime, no conditional resolution.
The public API surface is identical to upstream. All upstream documentation applies.
Reference Pages
- Type System — schema definition, primitives, complex types, logical types, type inference, schema evolution
- Serialization — encoding, decoding, the Tap buffer, schema fingerprints
- Container Files — block encoding/decoding streams, file headers, codecs
- Schema Parsing — JSON schemas, IDL protocols, import resolution
- Barification — what was changed from upstream, platform dependencies, polyfills
Library Reference
The library’s own reference site: bare-for-pear.github.io/avsc — plain API documentation without architectural context.