- import yaml from "js-yaml";
- import JSON5 from "json5";
- import ini from "ini";
+ import yaml from "tinyaml/js-yaml";
+ import JSON5 from "tinyjson5";
+ import ini from "tinyini";One package per format
Section titled "One package per format"Each is published on its own, so you install only what you use.
- tinyamlReplaces js-yaml 4 and 5, yaml, yamljs and @std/yaml, one subpath each. 1.5× faster and 18% smaller than js-yaml.
- tinyjson5Replaces json5 2.2.3. 3.0 KB gzipped where json5 is 7.5 KB, and parses 8 to 9 times faster.
- tinyiniReplaces ini 7.0.0. The same 1.6 KB, and parses and stringifies 2 to 2.9 times faster.
Next to what they replace
Section titled "Next to what they replace"| You use | Switch to | Size, gzip | Parses | Stringifies |
|---|---|---|---|---|
| js-yaml 4 | tinyaml/js-yaml |
14.4 → 11.7 KiB | 1.5× faster | 1.6× faster |
| js-yaml 5 | tinyaml/js-yaml-v5 |
17.1 → 16.0 KiB | 1.5× faster | 1.8× faster |
| yaml | tinyaml/yaml |
29.9 → 16.8 KiB | 12.6× faster | 2.8× faster |
| yamljs | tinyaml/yamljs |
8.8 → 8.0 KiB | 5.0× faster | 1.1× faster |
| @std/yaml | tinyaml/std |
11.3 → 10.7 KiB | 2.0× faster | 1.6× faster |
| json5 2.2.3 | tinyjson5/json5 |
7.6 → 3.2 KiB | 7.7× faster | 5.3× faster |
| json5 1.0.2 | tinyjson5/json5-v1 |
8.4 → 3.3 KiB | 8.1× faster | 6.4× faster |
| strip-json-comments 3 | tinyjson5/strip-json-comments |
0.8 → 0.5 KiB | 4.1× faster | — |
| strip-json-comments 2 | tinyjson5/strip-json-comments-v2 |
0.7 → 0.5 KiB | 4.5× faster | — |
| strip-json-comments 5 | tinyjson5/strip-json-comments-v5 |
0.6 → 0.6 KiB | 4.2× faster | — |
| jsonc-parser 3.3.1 | tinyjson5/jsonc-parser |
6.6 → 5.9 KiB | 1.2× faster | — |
| comment-json 4.6.2 | tinyjson5/comment-json |
35.7 → 17.5 KiB | 1.6× faster | 1.2× faster |
| jju 1.4.0 | tinyjson5/jju |
9.8 → 9.6 KiB | 1.2× faster | 1.4× faster |
| ini 7.0.0 | tinyini |
1.6 → 1.6 KiB | 2.0× faster | 2.9× faster |
Starting fresh with YAML? The root tinyaml API is the smallest of all: 7.8 KiB, 1.8× smaller than js-yaml 4 and 3.8× smaller than yaml. It parses 19.3× faster than yaml and stringifies 12.5× faster.
Size is the minified bundle, gzipped. Speed is the median time to parse and stringify each package's large benchmark file. Measured on Apple M4, Node 26.13 (tinyaml, tinyini) and AMD Ryzen 7 255 w/ Radeon 780M Graphics, Node 24.21.0 (tinyjson5).
Questions
Section titled "Questions"How close is each package to the library it replaces?
Each one runs the original library's own tests and is compared with it on fuzzed inputs: 1 million for tinyjson5, 6 million calls for tinyini, and every yaml-test-suite case plus thousands of edits for tinyaml. Each package's compatibility page lists every known difference: tinyaml, tinyjson5, tinyini.Can I load them with require()?
Yes. All three ship ESM only, and Node 22.12 and later load ESM fromrequire(). Bundlers handle them too.