safe-stable-stringify is a robust JavaScript library for serializing JavaScript objects into JSON strings, ensuring stable and reproducible output. Unlike standard JSON.stringify, it employs a deterministic sorting algorithm for object keys, eliminating variations in the output string based on key order. This is crucial for hashing, caching, and comparison scenarios where consistent string representation is paramount. It handles circular references safely, preventing stack overflow errors, and offers customizable replacer functions for advanced control over serialization.
The npm package safe-stable-stringify has had sporadic releases since January 2018. Initial releases were infrequent. Activity peaked in late 2021. Releases slowed significantly after 2022, with only one release in March 2023 and one in August 2024. There have been no releases in 2025 as of September 9th.
Safe-stable-stringify's downloads surged throughout 2024 and 2025, peaking in July 2025 at over 92 million. From March 2024 to August 2025, downloads consistently increased month-over-month. September 2025's partial data shows a significant drop, but it's incomplete given today's date.