The solutions that I found involved either the Python module json.tool or major modes, both of which were new concepts to me, and neither of which actually formatted my JSON. This is a trivial task with the JSTool plugin for Notepad++, and I assumed it would be a well-solved problem for Emacs, so I went to the Googles. I had 96 unformatted JSON files that looked something like this (generated with ):Īt first, I thought that I’d only want to view several of the files, so I looked for an Emacs solution to pretty print JSON. If you’re feeling lucky but distracted, and like a good story, read on. If you’re feeling lucky but cautious, see the disclaimers at the end of this article. TL DR If you’re feeling lucky, here’s my handy solution to replace raw JSON with formatted JSON. I recently took some time to solve the problem of how to view all this data in a way that’s efficient and easy to understand. For simple applications, looking at JSON strings in Notepad++ or pasting them into is all I need, but when I’m building big applications, talking to multiple REST endpoints, designing unit tests, mock objects and doing a bunch of modeling at the intersection of a UI and back end services, I can quickly find myself flooded with too many JSON responses for those solutions to be viable. By April Eggers, Senior Software Developer, FDIĪs a front-end developer, I use JSON – a lot.
0 Comments
Leave a Reply. |