lossless-json is a JavaScript library for parsing and stringifying JSON while preserving numeric information, including large numbers and formatting that native JSON.parse/JSON.stringify can corrupt. It parses numbers into a LosslessNumber type that stores numeric values as strings and throws errors if an operation would lose precision. Useful when you need to round-trip JSON that contains long integers from systems like C++, Java, or C#.
Project status
- Actively maintained, the repo had an upstream push on 2026-07-31 and shipped update v4.3.1 the same day (indicating current development rather than dormancy).
- Update cadence looks moderate, v4.3.1 came about 9 months after v4.3.0 (2025-10-03), with earlier updates also spaced by months (v4.2.0 on 2025-08-28).
AI summary generated
Recent updates
v4.3.1
This release (v4.3.1) includes a targeted change to number parsing utilities, specifically how zero values are split and compared. The bundled code changes normalize non-canonical zero inputs like "0e5", "0.0", and negative zero, and update tests to ensure consistent reconstruction and ordering.
v4.3.0
No release notes content was provided for v4.3.0. The code diff shows a substantial API enhancement to LosslessJSON.parse(), adding an options object that can customize how duplicate keys are handled, while still supporting the previous style of passing a number parser function as the third argument.
v4.2.0
Release v4.2.0 was published on 2025-08-28, but no release notes were provided by the publisher. Because the release notes content is missing, there is not enough information to identify new features, breaking changes, bug fixes, security updates, or dependency changes.
v4.1.1
No release notes were provided in the release notes section for v4.1.1. The diff indicates a focused fix for `isSafeNumber` related to floating point round-off behavior, plus additional test coverage for negative values and new number-digit utilities.
Featuresv4.1.0
Release v4.1.0 introduces new public comparison utilities for lossless numbers, and significantly refactors internal number handling utilities (digit counting, splitting, and comparisons). It also updates the development toolchain and CI matrix to test against Node.js 22. Release notes provided in the prompt are empty, so the changes below reflect what the code diff actually contains.
v4.0.2
v4.0.2 contains mostly internal code changes, plus tooling and dependency updates. The runtime diffs focus on switching from global parsing functions (parseFloat/parseInt) to their Number.* equivalents, and on consistent string template usage for error messages and formatting.
v4.0.1
v4.0.1 is a small patch release (9 files changed, +38/-18 lines). The main code change is making the parse reviver and stringify replacer parameters accept null, plus several TypeScript typing and safety adjustments.
v4.0.0
v4.0.0 introduces a TypeScript typing change around the JSON value type used by the `reviver`/replacer flow, shifting from `JSONValue` to `unknown`. The release notes section for this version was not provided, but the repo code and documentation updates clearly reflect a breaking type-level API shift.
v3.0.2
This release is a small patch update (v3.0.2) focused on improving parsing behavior around invalid or truncated Unicode escape sequences. The only functional change in the diff is within the Unicode error handling path, plus accompanying test updates and a version bump.
v3.0.1
Release v3.0.1 was published on 2023-11-06, but the publisher did not provide any release notes or change log details. As a result, the developer-impacting changes (features, fixes, breaking changes, security, dependencies) cannot be determined from the provided information.