Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 936 Bytes

README.md

File metadata and controls

44 lines (31 loc) · 936 Bytes

JSONprint

Print JSON objects pretty. +colours +comma-first +optional-quotes written in livescript. build:

make           => make build test
make install   => npm install and make build

example:

var JSONprint = require('JSONprint');

var obj = {
    foo: true,
    bar: /meh/gim,
    baz: { qaz: [1, true, 'three'] }
};

console.log( JSONprint(obj) );

or directly to the stdout: JSONprint.log(obj);

screenshot

Options

JSONprint :: String | Object -> Object? -> String

defaults: { quote : '"' -- Use this char as quote quoteKeys : true -- Quote JSON keys collapseArray : true -- Print arrays in one line colors : false -- Klickibunti commaFirst : false -- place commas after \n }

WIP:

  • new lexer
  • deeper tests
  • html output