unstale

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 init

@unstale/cli on npm

safe-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.

    3.0.0release notes

  • Node.js 18 or later is required; older versions may still work but are not supported.

    3.0.0release notes

New APIs and options 2

  • The bigint option accepts 'string', serializing bigint values as JSON strings.

    3.0.0release notes

  • 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.

    3.0.0release notes

Performance 1

  • Sorting and escaping are faster on newer Node.js versions.

    3.0.0release notes

Fixes and other changes 4

  • ESM imports work in Node.js and bundlers, including applications that also use CommonJS.

    3.0.0release notes

  • Fixed an off-by-one error that caused one fewer entry than intended to be skipped.

    3.0.0release notes

  • Using a negative spacer number no longer throws.

    3.0.0release notes

  • Non-finite floating-point typed array values, such as Infinity in a Float32Array, are now serialized correctly.

    3.0.0release notes