Skip to content

Alternative JSON.stringify function with sorted keys, so the output is stable.

License

Notifications You must be signed in to change notification settings

fabiospampinato/json-sorted-stringify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Sorted Stringify

Alternative JSON.stringify function with sorted keys, so the output is stable.

Install

npm install json-sorted-stringify

Usage

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

About

Alternative JSON.stringify function with sorted keys, so the output is stable.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •