npm / lossless-json
lossless-json
What changed in lossless-json 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
5 breaking16 new APIs and options1 performance1 tooling
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initlossless-json 223 changes
Breaking changes 5
Support for circular references has been dropped; circular data structures should be prevented.
The constructor now accepts only a string; use toLosslessNumber to safely convert a number.
The undocumented .type property was dropped; use .isLosslessNumber instead.
Official support for Node.js 12 has been dropped.
parse now throws an error when it encounters a duplicate key.
New APIs and options 16
Built-in support for bigint was added.
Built-in Date support was added and is turned off by default; see reviveDate.
The library now exports ES modules, allowing developers to import only the functions they need instead of pulling in the full bundle.
getUnsafeNumberReason was added as an exported utility function.
isInteger was added as an exported utility function.
isLosslessNumber was added as an exported utility function.
isNumber was added as an exported utility function.
isSafeNumber was added as an exported utility function.
A new option makes serialization of numeric values customizable, supporting integration with BigNumber libraries or custom conversion logic.
parseLosslessNumber was added as an exported utility function.
A new option makes serialization of numeric values customizable, supporting integration with BigNumber libraries or custom conversion logic.
parseNumberAndBigInt was added as an exported utility function.
The release adds reviveDate for built-in Date support, which is turned off by default.
toLosslessNumber was added as an exported utility function for safely converting a number into a LosslessNumber.
toSafeNumberOrThrow was added as an exported utility function.
The library now exports a UMD bundle.
Performance 1
Performance of both parse and stringify has been improved.
Tooling 1
The library now comes with TypeScript definitions.