Skip to content

Releases

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 03 Nov 08:52
b2b41ac

v0.1.1 is the next patch release.

👉 Changelog

compare changes

🩹 Fixes

  • tinyini: export TokenTypes as a type too, as @one-ini/wasm's enum is (#30)

📖 Documentation

  • say when to use yaml instead of tinyaml (#29)
  • compare tinyaml with yaml 3.0.0-2 as well as yaml 2.9.1 (#28)
  • state the yaml version in comparisons and correct claims about yaml (#27)
  • put npx tinyswap in the landing hero, show the questions as a plain list (#25)

❤️ Contributors

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 02 Nov 09:39
d07818f

tiny

Change one import

npx tinyswap

tinyswap finds js-yaml, yaml, yamljs, @std/yaml, json5, strip-json-comments, jsonc-parser, comment-json, jju, ini and @one-ini/wasm in your project, picks the subpath for the version you have installed, shows the diff, then rewrites the imports and swaps the dependencies. Or do it by hand:

- import yaml from "js-yaml";
+ import yaml from "tinyaml/js-yaml";

- import JSON5 from "json5";
+ import JSON5 from "tinyjson5/json5";

- import ini from "ini";
+ import ini from "tinyini/ini";

The calls, options, output and errors stay the same.

What you get

You use Switch to Size, gzip Parses Stringifies
yaml tinyaml/yaml 29.8 → 16.9 KiB 12.0× faster 2.8× faster
js-yaml 4 tinyaml/js-yaml 14.4 → 11.6 KiB 1.6× faster 1.7× faster
json5 2.2.3 tinyjson5/json5 7.5 → 3.2 KiB 7.4× faster 4.7× faster
comment-json 4.6.2 tinyjson5/comment-json 35.3 → 18.2 KiB 1.8× faster 1.3× faster
@one-ini/wasm 0.2.1 tinyini/one-ini 36.0 → 1.7 KiB 12.4× faster —
ini 7.0.0 tinyini/ini 1.6 → 1.5 KiB 1.8× faster 2.9× faster

Writing new code? The root tinyaml API is 7.7 KiB. It parses 18.7× faster than yaml, stringifies 12.9× faster, and gets all 373 yaml-test-suite cases with an expected result right. js-yaml, yaml, yamljs and @std/yaml each get some wrong.

The full table lists all 18 drop-ins. Measured on an Apple M4 with Node 26.13.0.

How we know they match

A drop-in only helps if nothing breaks. Each one passes the original library's own test suite and is fuzzed against the original: a million inputs per subpath for tinyjson5 and tinyini, and thousands per subpath for tinyaml. Each one also covers the edges, from errors and warnings to getters, proxies and sloppy-mode writes. Every known difference is listed in that package's README, along with bugs in the original that tiny doesn't copy.

Typed config imports

VS Code: importing config.yaml gives it a TypeScript type, and a misspelled key is an error

All three parsers are TypeScript 7.1 content mappers. Register one in tsconfig.json, and an import config from "./config.yaml" (or .json5, .jsonc, .ini) is typed the way a .json import is. A typo in a key becomes a type error, and a syntax error shows up at its line and column.

A YAML linter

VS Code with tinyaml/eslint: draft: no and published: 2026-11-01 are underlined, because other YAML readers load them as a boolean and a date

tinyaml-lint catches YAML that other readers load differently, such as no as a boolean or 2026-11-01 as a date. It runs from the CLI, as a library (tinyaml/linter), as an ESLint plugin (tinyaml/eslint) and as a Vite Doctor extension (tinyaml/doctor).

Install

pnpm add tinyaml tinyjson5 tinyini

Each package is published on its own, so install only what you use. Docs at tiny.onmax.me.

👉 Changelog

🚀 Enhancements

  • type .yaml, .json5, .jsonc and .ini imports with TypeScript 7.1 content mappers (#18)
  • add tinymigrate, a wizard that moves a project to the drop-ins (#15)
  • add a YAML linter and a Vite Doctor extension (#6)
  • tinyjson5: add tinyjson5/jju, a drop-in for jju 1.4.0 (ae4853f)
  • tinyjson5: add tinyjson5/comment-json, a drop-in for comment-json 4.6.2 (3c1dd49)
  • tinyjson5: add tinyjson5/jsonc-parser, a drop-in for jsonc-parser 3.3.1 (76c48ba)
  • tinyjson5: add drop-ins for strip-json-comments 2, 3 and 5 (0e9401e)
  • tinyjson5: add tinyjson5/json5-v1, a drop-in for json5 1.0.2 (553025e)
  • tinyjson5: give the root json5 3's rules and a strict jsonc option (787ee99)
  • tinyini: add tinyini/one-ini and tinyini/one-ini-v0.1 (74e11b1)
  • tinyini: add tinyini/ini-v1 and tinyini/ini-v2 from the shared core (10c6206)
  • tinyini: give the root its own INI API, without ini's legacy (2f34e60)
  • add drop-in entries for js-yaml 4 and 5, yaml, yamljs and @std/yaml (a69764c)
  • add tinyaml, a YAML loader and dumper with js-yaml JSON_SCHEMA semantics (ed8e6b4)

🔥 Performance

  • tinyjson5/jsonc-parser: look for control characters in the string itself, not with a regex that reruns at each line (c654727)
  • tinyjson5/jju: make jju's silent writes with one sloppy-mode function, not Reflect (d1101d9)

🩹 Fixes

  • remove five more quadratic paths, close the twelfth review's findings, and list the bugs tinyaml doesn't copy (1b909b5)
  • read byte order marks and warnings in linear time, and close the eleventh review's findings (ed604d1)
  • close the tenth review's findings (9452614)
  • close the ninth review's findings (23797f4)
  • close the seventh review's findings (e4bc01e)
  • tinyaml/js-yaml-v5: build the null limit without a chained type assertion (ce8f288)
  • close the fifth and sixth reviews' findings, and make the linter use the parser (c5c516c)
  • tinyjson5/jsonc-parser: build the enums, error names and format comparison without built-ins jsonc-parser doesn't call (0ae91ee)
  • tinyjson5/comment-json: keep the faster paths only with this realm's Array, String and Object prototypes (9e7e675)
  • tinyjson5/jsonc-parser: read characters as jsonc-parser does in string errors and comment lookahead, and document sliced token values (6478451)
  • tinyini: check each package specifier loads its own mode, and read typed-array lengths across realms (8212df6)
  • tinyini: probe each bundle's mode behaviour, compare other one-ini builds by version field only, and match boxed strings and shadowed typed-array lengths (a21b2cd)
  • tinyini: keep one-ini's working data out of arrays, read root arrays as JSON does, and reject invalid fuzz counts (ae6c212)
  • tinyini: build the one-ini AST after parsing, as serde does, and stop root arrays at their first length (84707df)
  • tinyini: fail the oracle scripts on a broken harness, and match toJSON, inherited AST names and the glue's length read (d663ec0)
  • tinyjson5/comment-json: restore an outer stringify's cache, throw the engine's TypeError, check constructors before reading them, convert odd keys at each lookup (0e95043)
  • tinyjson5/jsonc-parser: scan strings a character at a time as jsonc-parser does, without a fast path that reads some twice (80b2607)
  • tinyjson5/comment-json: read Symbol.for at each comment lookup as comment-json does, and bind only a call whose name and length are data (8980d5c)
  • close the fourth review's findings, and find yaml's second document where yaml does (7332668)
  • tinyjson5/comment-json: split comment keys with the captured string built-ins, step aside when the global Symbol changes, and keep undefined as a prop (0623075)
  • tinyjson5/comment-json: read every built-in from globalThis's descriptors and probe it on private receivers; look up comments by prefix and prop (44681e4)
  • tinyjson5/comment-json: check each kept built-in does its own job, not another's of the same name (883ecc6)
  • tinyjson5/comment-json: know the engine's own built-ins by name, and read them without running getters (f20c101)
  • tinyjson5: typecheck without fetched fixtures, and run CommonJS originals' own tests on Node 22 (e2eef3a)
  • tinyjson5/comment-json: take the faster paths only with the...
Read more