jsonsmash - a shell for browsing json files
This projects solves the problem of browsing large json files by providing an
emulated shell environment that treats the json file as if it were a filesystem.
This allows the file to be browsed using commands such as
viewed (in human readable yaml) using
This project is build with
node and is installable using
npm. It should be
$ npm install jsonsmash -g
Any valid json file can be opened by calling
$ jsonsmash /path/to/jsonfile.js
Data can also be loaded from a url by calling
$ jsonsmash http://example.come/somejson.json
After opening jsonsmash a prompt will appear to accept commands.
The jsonsmash shell treats the json data structure as a file system, with the
root of the data structure represented as
/ and the keys as either directories
(for objects and arrays) or files.
Paths can be either absolute or relative. Absolute paths must begin with
Commands that require a path will default to using the current working directory.
cat [--json] [path]
Print the data structure, defaulting to yaml for human readablility.
--json flag is passed the output will be in unformatted json.
Change to the specified path.
echo [string ...]
Print the argument passed to it.
Close the jsonsmash shell.
ls [-lhSr] [path]
Display the children of the specified paths.
-llist in long format.
-huse unit suffixes (K,M,G,T) to reduce number of digits to three or less.
-Ssort by size instead of alphabetically.
-rreverse sort order.
Print the current working directory.
$ jsonsmash http://headers.jsontest.com/ > cat X-Cloud-Trace-Context: dbaae9ed37134e4c86d1e02147fe2676/1875084932880129464 Host: headers.jsontest.com > ls -lh 29 string Host 78 string X-Cloud-Trace-Context