format-json-pretty
format object to pretty json
update: Support for defining the number of indent spaces. The default is 2
INSTALL
npm install format-json-pretty
TEST
npm run test
DEMO
var formatJson = ; var user = id: 1 name: 'fengliner' color: id: 1 name: 'fengliner' font: id: 1 name: 'fengliner'; console; /**{ "id": 1, "name": "fengliner", "color": { "id": 1, "name": "fengliner" }, "font": [{ "id": 1, "name": "fengliner" }]}*/ console; /** { "id": 1, "name": "fengliner", "color": { "id": 1, "name": "fengliner" }, "font": [{ "id": 1, "name": "fengliner" }]}*/