Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Sort JSON Documents & Keys in VS Code

If you’re working with JSON documents, you may want to clean them up and sort all the Object Keys Alphabetically.

This can make the files more readable and consistent, but it can also improve the compression and reduce the file size.

To sort the document, press CTRL + SHIFT + P type in ‘json sort document‘ and pick the JSON: Sort Document command.

This will sort the object keys alphabetically and remove any redundant whitespace characters.

 Want to watch a video to supplement your reading? Check this out:

The JSON: Sort Document Command comes with the JSON Language Features built-in extension.

So if you want to fiddle with your JSON settings, this is the place to start from.

Happy coding


Let me know what you think about this article through comments below, or on Twitter at @pelu_carol.

If you find this article helpful, please share it with others and subscribe to the blog to support me, and receive a bi-monthly-ish e-mail notification on my latest articles.



This post first appeared on Neutron Dev, please read the originial post: here

Share the post

Sort JSON Documents & Keys in VS Code

×

Subscribe to Neutron Dev

Get updates delivered right to your inbox!

Thank you for your subscription

×