https://github.com/fabiospampinato/json-sorted-stringify
Alternative JSON.stringify function with sorted keys, so the output is stable.
https://github.com/fabiospampinato/json-sorted-stringify
json sorted stable stringify
Last synced: 2 months ago
JSON representation
Alternative JSON.stringify function with sorted keys, so the output is stable.
- Host: GitHub
- URL: https://github.com/fabiospampinato/json-sorted-stringify
- Owner: fabiospampinato
- License: mit
- Created: 2023-02-17T23:35:18.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-18T00:11:57.000Z (9 months ago)
- Last Synced: 2025-06-25T12:06:52.362Z (3 months ago)
- Topics: json, sorted, stable, stringify
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# JSON Sorted Stringify
Alternative `JSON.stringify` function with sorted keys, so the output is stable.
## Install
```sh
npm install json-sorted-stringify
```## Usage
```ts
import stringify from 'json-sorted-stringify';// Let's stringify in a sorted/stable manner
stringify ({ a: 1, b: 2 }); // => '{"a":1,"b":2}'
stringify ({ b: 2, a: 1 }); // => '{"a":1,"b":2}'
```## License
MIT © Fabio Spampinato