Analyze and measure where you should spend your time optimizing your JSON files or REST APIs. Use it either in our online demo, command line or in your node/browser project.
- Optimizing some REST API payload
- Initial server render redux state
- JSON files
- NO-SQL documents
- JSON like js objects
- Works in the browser
- Works in the command line
- Works in nodejs environment
with yarn:
yarn global add json-analyzer
with npm:
npm install --global json-analyzer
with pipe:
cat path/to/file.json | json-analyzer.js
without pipe:
json-analyzer.js path/to/file.json
Option | Description |
---|---|
--verbose |
Show more details of the JSON (like the biggest size node) |
--depth |
Recursive details of each JSON node (ignored if no verbose option) |
--target |
Where to start the analyze (use lodash.get syntax) |
--version |
Display the version of json-analyzer |
with yarn:
yarn add json-analyzer
with npm:
npm install json-analyzer --save
with require:
const jsonAnalyzer = require("json-analyzer");
const jsonObj = { "hello": "world" };
console.log(
jsonAnalyzer({ json: jsonObj })
);
with import:
import jsonAnalyzer from "json-analyzer";
const jsonObj = { "hello": "world" };
console.log(
jsonAnalyzer({ json: jsonObj })
);
Option | Description |
---|---|
json |
JSON like object already parsed |
verbose |
Recursive details of each JSON node (ignored if no verbose option) |
maxDepth |
Recursive details of each JSON node (ignored if no verbose option) |
target |
Where to start the analyze (use lodash.get syntax) |
This project is licensed under the MIT license, Copyright (c) 2018 Luis Silva. For more information see LICENSE