Skip to content

Instantly share code, notes, and snippets.

@kemitchell
Created June 29, 2015 20:21
Show Gist options
  • Save kemitchell/e5ded291c397bf8938f5 to your computer and use it in GitHub Desktop.
Save kemitchell/e5ded291c397bf8938f5 to your computer and use it in GitHub Desktop.

At the command line:

$ npm install --global lispy-json
$ lispy-json < example.json
{ "glossary": {
    "title": "example glossary",
    "GlossDiv": {
      "title": "S",
      "GlossList": {
        "GlossEntry": {
          "ID": "SGML",
          "SortAs": "SGML",
          "GlossTerm": "Standard Generalized Markup Language",
          "Acronym": "SGML",
          "Abbrev": "ISO 8879:1986",
          "GlossDef": {
            "para": "A meta-markup language, used to ...",
            "GlossSeeAlso": [
              "GML",
              "XML" ] },
          "GlossSee": "markup" } } } } }

In JavaScript, via npm:

var format = require('lispy-json')

console.log(format({ an: 'object' }))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment