npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jsonsmash

v0.3.0

Published

JSON Shell

Downloads

2

Readme

jsonsmash - a shell for browsing json files

npm package

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 ls and cd or viewed (in human readable yaml) using cat.

Install

This project is build with node and is installable using npm. It should be installed globally.

$ npm install jsonsmash -g

Usage

Any valid json file can be opened by calling jsonsmash path.

$ jsonsmash /path/to/jsonfile.js

Data can also be loaded from a url by calling jsonsmash url.

$ jsonsmash http://example.come/somejson.json

After opening jsonsmash a prompt will appear to accept commands.

Paths

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.

Commands

cat

cat [--json] [path]

Print the data structure, defaulting to yaml for human readablility.

If the --json flag is passed the output will be in unformatted json.

cd

cat [path]

Change to the specified path.

echo

echo [string ...]

Print the argument passed to it.

exit

exit

Close the jsonsmash shell.

ls

ls [-lhSr] [path]

Display the children of the specified paths.

  • -l list in long format.
  • -h use unit suffixes (K,M,G,T) to reduce number of digits to three or less.
  • -S sort by size instead of alphabetically.
  • -r reverse sort order.

pwd

pwd

Print the current working directory.

Examples

$ 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