js-yaml
5.5.0 · 15 Oct 2026MIT322.7M / weekRepositoryHomepagenpmAtom feed
5.5.0 is the newest release of 5.x.
In short
2 breaking2 new5 fixed1 changed
- breaking
Flattened the low-level AST node style representation. Scalar and collection nodes now use
SCALAR_STYLEandCOLLECTION_STYLEvalues; explicit tags use the separatetaggedproperty. Alias nodes now contain onlykindandanchor. This only affects code that directly constructs or edits AST nodes. - breaking
The
sortKeysoption was rewritten using AST mutation to avoid side effects.
Security
1 advisory affects 5.4.0; 5.4.1 fixes them
- Moderatejs-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sourcesGHSA-r3ph-w7gj-g6xm · 29 Sep 2026Fixed in 5.4.1
Release note
Added
Added the
scalarStyleRulesdumper option to customize string formatting.
See Scalar styling for details.
Changed
- breaking
Flattened the low-level AST node style representation. Scalar
and collection nodes now useSCALAR_STYLEandCOLLECTION_STYLEvalues;
explicit tags use the separatetaggedproperty. Alias nodes now contain
onlykindandanchor. This only affects code that directly constructs or
edits AST nodes. - breaking
The
sortKeysoption was rewritten using AST mutation to avoid
side effects. Reworked scalar style selection. This can change formatting without changing
loaded values; in particular, whitespace-only strings are now double-quoted.
Fixed
Accept a byte order mark at the start of each document in a stream, #791.
Produce valid flow mappings with
quoteFlowKeysandflowSkipColonSpace,
including alias and property-only keys, #786.Preserve empty scalar items when converting block sequences to flow style.
Do not apply the 1024-character simple-key limit to flow mapping keys.
Count Unicode code points, rather than UTF-16 code units, for the
1024-character simple-key limit.Add an explicit document-end marker after keep-chomped block scalars when
needed to preserve trailing newlines.