Search code snippets, questions, articles... Chrome Extension

Compress or minify JSON using Javascript

To compress or minify JSON using Javascript, you can use the below code.
var json_str = `[
      "type": "people",
      "id": "30",
      "attributes": {
        "name": "John Deo",
        "age": 40,
        "gender": "male"

var minified_json = JSON.stringify(JSON.parse(json_str));
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
Was this helpful?
Join Devsheet Ask a Question