Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jsonlines and similar formats where each payload is stored as unindented JSON chunks divided by newlines are great for complex systems.
- My application is more to aid in exploring large JSON files and copying/pasting, chunks in the editor, therefore made this small JSON stringifier that breaks the 1st level of arrays and objects with newlines,while returning valid JSON.
- The placement of commas is intentional. This way one can find the item, right, shift+end, copy.
- ```js
- jsonlishStringify([4,true,'yay'])
- `[
- 4
- ,true
- ,"yay"
- ]`
- jsonlishStringify({a:4,b:true,c:'yay'])
- `[
- "a":4
- ,"b":true
- ,"c":"yay"
- ]`
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement