fast-json-format is a JavaScript library that pretty-prints JSON strings without parsing them, which means you can format JSON containing BigInt literals without losing precision. The library handles these scenarios:
- Preserves BigInt values like 12345678901234567890n that would break JSON.parse
- Keeps decimal formatting intact (1.2300 stays 1.2300)
- Tolerates malformed JSON instead of throwing errors
- Zero dependencies, single file implementation
Check it out if you're working with APIs that return large integers or need to format JSON-like strings from logs where syntax might be imperfect.
๐ Blog Post
๐ GitHub Repo
๐ Live Demo
Top comments (0)