npm / safe-stable-stringify
safe-stable-stringify
What changed in safe-stable-stringify 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
2 breaking2 new APIs and options1 performance4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initsafe-stable-stringify 39 changes
Breaking changes 2
The default circular marker is now '[Circular: N]', where N is the referenced ancestor's depth; set circularValue to '[Circular]' to retain the previous format.
Node.js 18 or later is required; older versions may still work but are not supported.
New APIs and options 2
The bigint option accepts 'string', serializing bigint values as JSON strings.
The safe option prevents failures when a getter, .toJSON(), or replacer throws, replacing the object inspection with a string error message; it defaults to false.
Performance 1
Sorting and escaping are faster on newer Node.js versions.
Fixes and other changes 4
ESM imports work in Node.js and bundlers, including applications that also use CommonJS.
Fixed an off-by-one error that caused one fewer entry than intended to be skipped.
Using a negative spacer number no longer throws.
Non-finite floating-point typed array values, such as Infinity in a Float32Array, are now serialized correctly.