simple-json-formatter
Advanced tools
+40
| Format JSON string with indent. | ||
| ## Typescript Example | ||
| ``` | ||
| import * as JSONFormatter from "json-formatter"; | ||
| let a = { | ||
| b: 42, | ||
| c: "d", | ||
| e: [ | ||
| "f", | ||
| "g" | ||
| ], | ||
| h: { | ||
| i: "j", | ||
| k: null | ||
| } | ||
| } | ||
| let json = JSON.stringify(a); | ||
| console.log(json); | ||
| let formattedJson = JSONFormatter.format(json, "\t"); | ||
| console.log(formattedJson); | ||
| ``` | ||
| Output: | ||
| ``` | ||
| {"b":42,"c":"d","e":["f","g"],"h":{"i":"j","k":null}} | ||
| { | ||
| "b": 42, | ||
| "c": "d", | ||
| "e": [ | ||
| "f", | ||
| "g" | ||
| ], | ||
| "h": { | ||
| "i": "j", | ||
| "k": null | ||
| } | ||
| } | ||
| ``` |
+1
-1
| { | ||
| "name": "simple-json-formatter", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "A JSON formatter", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
94312
0.71%8
14.29%1
-50%41
Infinity%