Skip to content

danieltrost/json-sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

json-sort

This atom plugin allows you sort JSON in the text editor. Additionally, this will format the JSON to be indented with 4 spaces by default, however, it can be configured within the package settings to your desired indent.

How to use json-sort

  1. Highlight the JSON you want to sort
  2. Press Control + Alt/Option + O or Command + Shift + P and search for JSON Sort

Example of json-sort

Starting code:

{
"some": "string",
"another": true,
"here": 123
}

Output of json-sort:

{
    "another": true,
    "here": 123,
    "some": "string"
}

Also works for nested JSON:

{
"test": {
"zzz": "asdf",
"aaa": "asdf"
},
"a": {
"x": "asdf",
"a": "asdf",
"v": "asdf"
}
}

Result of nested JSON:

{
    "a": {
        "a": "asdf",
        "v": "asdf",
        "x": "asdf"
    },
    "test": {
        "aaa": "asdf",
        "zzz": "asdf"
    }
}

About

Atom.io Package to sort JSON

Resources

Stars

Watchers

Forks

Packages

No packages published