All Projects → mjurczyk → json-viewer

mjurczyk / json-viewer

Licence: other
Pretty JSON viewer for the terminal

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to json-viewer

reky
Reky is an opensource API development platform. It automatically visualizes API response with outstanding graphs & tables.
Stars: ✭ 22 (-15.38%)
Mutual labels:  json-viewer
Cat-Face-Detector-with-OpenCV-and-JavaFX
📹 A Small OpenCV (Open Source Computer Vision) Example, who has the ability to detect multiple cat faces at the same time 🐱
Stars: ✭ 24 (-7.69%)
Mutual labels:  cat
mailcat
Find existing email addresses by nickname using API/SMTP checking methods without user notification. Please, don't hesitate to improve cat's job! 🐱🔎 📬
Stars: ✭ 219 (+742.31%)
Mutual labels:  cat
websocket-webcam
A pure javascript HTML5 webcam client using websockets to stream the image
Stars: ✭ 31 (+19.23%)
Mutual labels:  cat
table2ascii
Python library for converting lists to fancy ASCII tables for displaying in the terminal and on Discord
Stars: ✭ 31 (+19.23%)
Mutual labels:  pretty-print
kitty-time
Stressed after coding for hours? Need a break? Perhaps an inspiration? Something to calm your nerves after almost pushing that fatal git commit? It's Kitty Time! =(^● ⋏ ●^)= ෆ"
Stars: ✭ 12 (-53.85%)
Mutual labels:  cat
ToRat client
This is the ToRat client, a part of the ToRat Project.
Stars: ✭ 29 (+11.54%)
Mutual labels:  cat
Online-News-Portal-with-Django
Daily News For You is an online news portal developed by Django and SQLite
Stars: ✭ 45 (+73.08%)
Mutual labels:  cat
plugin.video.tv3.cat
Kodi addon
Stars: ✭ 16 (-38.46%)
Mutual labels:  cat
jsonpp-rs
UNIX style tool to pretty print json
Stars: ✭ 26 (+0%)
Mutual labels:  pretty-print
Corecat
Corecat: Core library
Stars: ✭ 21 (-19.23%)
Mutual labels:  cat
go-logsink
the multi machine cat over protocol buffers and websocket
Stars: ✭ 34 (+30.77%)
Mutual labels:  cat
tv
📺(tv) Tidy Viewer is a cross-platform CLI csv pretty printer that uses column styling to maximize viewer enjoyment.
Stars: ✭ 1,763 (+6680.77%)
Mutual labels:  pretty-print
as-table
A simple function that prints objects as ASCII tables. Supports ANSI styling and weird Unicode 💩 emojis – they won't break the layout.
Stars: ✭ 54 (+107.69%)
Mutual labels:  pretty-print
catmoji-colr
Twemoji, but with cats! Unicode 13.1! 🐱
Stars: ✭ 41 (+57.69%)
Mutual labels:  cat
spark list
这是一款开源笔记应用, 支持Android/iOS双平台, 使用Flutter 3开发, 体验Flutter的同时也希望做一个能成为个人知识中转站的应用, 任重道远 :)
Stars: ✭ 47 (+80.77%)
Mutual labels:  cat
bat-zh
🇨🇳翻译: <bat> 一个`cat(1)`克隆与语法高亮和Git集成 ❤️ 校对 ✅
Stars: ✭ 129 (+396.15%)
Mutual labels:  cat
react-redux-cats
React and Redux with cats
Stars: ✭ 23 (-11.54%)
Mutual labels:  cat
catAPI
RESTful API that will deliver photos with cats on demand
Stars: ✭ 66 (+153.85%)
Mutual labels:  cat
hgrep
Grep with human-friendly search results
Stars: ✭ 335 (+1188.46%)
Mutual labels:  pretty-print

JSON Viewer

Pretty JSON viewer for your terminal

jsonviewer2


🚀 master ▶︎ npm version CircleCI codecov

🛠 develop ▶︎ GitHub version CircleCI codecov maintainer

📚 dependencies ▶︎ dependencies Status devDependencies Status

👀 code climate ▶︎ Code Climate Issue Count


After only so many times of trying to recall a package script or dependency.

json-viewer allows you to preview your JSON files quickly, showing you only the parts you care to see in a beautiful and readable form.

Table of Contents

Installation

To use json-viewer you will need node environment installed on your system. With that ready, simply run:

npm install --global json-viewer

Yarn user? Not an issue:

yarn global add json-viewer

With that done, you are ready to go - json-viewer just became available to you as a json command!

Usage: Basic

There are several ways to use json-viewer depending on your preferences. The most basic use case would be:

json package.json version # -> "2.0.0"

In the first argument choose which file you would like to browse, and then specify which part of it you would like to see. It also works perfectly with arrays and objects!

json package.json keywords # -> [ "json", "viewer", "cli" ]

Usage: Colors

To add more readability, you can add -c or --color flag to the command:

json --color package.json dependencies
json -c package.json dependencies

This will add some styling to the output depending on its content.

Usage: Piping & Redirection

Have a chain of UNIX commands that generate some JSON output and you would really like to see it in a human-readable form? Look no further:

cat package.json | json -c

Want to go deeper? We say no to compromise:

cat package.json | json -c version

Note: If you use json-viewer in a pipe, the only argument you should specify is the part of the JSON you would like to see. If you put another file as an argument, json-viewer will assume it to be a property name inside the piped JSON.

Usage: Always Color

Using -c can be tiring if you do it quite often, so json-viewer offers you a shortcut. To set a permanent --color flag for json-viewer, simply use:

json --always-color

After that, json-viewer will remember your setting automatically every time you call it!

Usage: Autocompletion

Note: To use autocompletion see the installation instructions below!

json-viewer uses an amazing yargs library to offer some helpful autocompletion to you. How does it work? Let us see:

  • Hitting tab key twice will list you all of the files in the current directory
json # tab-tab!
> package.json    index.js    src/    ...
  • Hitting tab once will automatically finish the name of any fitting file in the current directory
json pa # tab!
json package.json
  • With a specified file, hitting tab twice will list you JSON properties in the file (Works great for nested properties as well!)
json package.json # tab-tab!
> name    keywords    scripts    dependencies    ...
  • With a specified file, hitting tab once will automatically finish the name of the property
json package.json dep # tab!
json package.json dependencies

You can now traverse around your JSON structure in no time!

Autocompletion Installation

You should be warned though - autocompletion does not come with json-viewer out of the box (not explicitly at least). To enable it, first use:

json completion

This will print you a complete script that has to be put into .bash_profile or .bashrc of your system / terminal. If you trust this README.md like you should, all you need to do is simply:

json completion >> ~/.bashrc
# or (depending on your system):
json completion >> ~/.bash_profile

This will append the necessary script to the necessary file. If you are feeling less confident about using some script someone on the internet told you to use™️, simply find .bash_profile or .bashrc using the terminal and add the completion script manually.

Save, reopen terminal, you are ready to go!

Contributing

Want to get your hands dirty on some fancy ES6 code, gain valuable experience, be able to place some significant achievements into your resume? Oh, are you in a right place and time!

Enlist today and contribute to json-viewer. The source code it up there, the ideas in your head, so fear not and put them into the code and create a pull request! How can you build, debug, test your code? Well, there we go with some helper scripts:

npm run build # build the /src directory and put the results into /lib

npm run start # build and run the latest /src

npm run test:live # this one tricky - build, locally pack and install the latest /src as json-viewer in the system. Great if you want to test the final product as a `json` command

Testing?

npm run test # run tests once

npm run test:watch # run tests everytime anything in /src changes

npm run lint # test if your code looks nice and is consistent with the rest of the codebase

npm run coverage # see how much code is tested and how much is not

npm run coverage:html # generate HTML coverage report in /coverage/index.html

There are no strict rules or assumptions for what can be done, although please consider coverage 100% your personal goal and achievement. Plus, of course, npm run test and npm run lint must pass!

Knowing all that, grab your pen, tear that sheet of paper out, and sketch new functionality today! Feel free to reach out via GitHub or email for any aid or explanations!

License

MIT :octocat:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].