Lightning YAML
YAML · 1.2 CORE
Parse YAML at JSON speed.
Pass more of the spec than anyone.
Dramatically faster than js-yaml and yaml, and more spec-conformant — 97.6% of the YAML Test Suite — with peak memory close to JSON.parse.
apiVersion: v1
kind: Service
metadata:
name: billing
spec:
ports: [{ port: 8080 }]{
apiVersion: "v1",
kind: "Service",
metadata: { name: "billing" },
spec: { ports: [{ port: 8080 }] }
}4.4×
faster than js-yaml
block-YAML parse
39×
faster than yaml
block-YAML parse
97.6%
YAML Test Suite pass
js-yaml 94.9% · yaml 97.1%
≈1.3×
of JSON.parse memory
peak RSS, 10 MB fixture
- Anchors, aliases, !!binary & multi-doc streams
- parse · parseAll · stringify
- js-yaml / yaml drop-in shims
- TypeScript-first types
- Zero dependencies
Drop-in is API-level today. Imports and call signatures matchjs-yaml and yaml, so existing code runs — but their option arguments (schema, sortKeys, indent, …) are still accepted but ignored. Useful for migrating now; not yet a 1:1 behavioural match.
What we optimise for
Spec-correct
97.6% of the YAML Test Suite — more of the spec than js-yaml(94.9%) or yaml (97.1%).
JSON-class speed
Parses at ~0.5× JSON.parse; 4–39× the JS competition on block YAML.
Lean memory
Peak RSS ≈1.3× JSON.parse — well under js-yaml /yaml.
Small bundle
≈14 kB min+gzip · tree-shakeable · zero deps.
representative target — bundle-size benchmark not wired up yet