Skip to content

Simple command-line tool that allows to sort JSON files w.r.t keys.

Notifications You must be signed in to change notification settings

WissenIstNacht/json-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json Sorter

Sort keys of a Json file in alphabetical order.

Running the script

To sort an input file and write the output to a copy of that file, run the following command from within this directory

# using node
node index.js <input file>

# using npm (exec)
npx ./

# or simply as executable
./index.js

The script takes arguments. For more information, run

node index.js -h

Example

Running the command on the provided example file example.json

node index.js ./example.json

will sort the file and write it to a new file called example_copy.json. If the copy already exists, it will be overwritten.

Adding an output file will create a new file in this directory containing the sorted json (or overwrite it, if it already exists).

node index.js ./example.json ./example_out

About

Simple command-line tool that allows to sort JSON files w.r.t keys.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published