An open API service indexing awesome lists of open source software.

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.

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