{"id":13438800,"url":"https://github.com/mjurczyk/json-viewer","last_synced_at":"2025-03-20T06:31:24.367Z","repository":{"id":57285471,"uuid":"53853008","full_name":"mjurczyk/json-viewer","owner":"mjurczyk","description":"Pretty JSON viewer for the terminal","archived":false,"fork":false,"pushed_at":"2019-01-16T22:09:51.000Z","size":160,"stargazers_count":26,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-03-17T23:57:34.026Z","etag":null,"topics":["cat","json","json-viewer","pretty-print"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjurczyk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-14T12:04:37.000Z","updated_at":"2025-01-05T07:51:23.000Z","dependencies_parsed_at":"2022-09-16T22:40:45.130Z","dependency_job_id":null,"html_url":"https://github.com/mjurczyk/json-viewer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjurczyk%2Fjson-viewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjurczyk%2Fjson-viewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjurczyk%2Fjson-viewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjurczyk%2Fjson-viewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjurczyk","download_url":"https://codeload.github.com/mjurczyk/json-viewer/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244565419,"owners_count":20473276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cat","json","json-viewer","pretty-print"],"created_at":"2024-07-31T03:01:08.538Z","updated_at":"2025-03-20T06:31:19.352Z","avatar_url":"https://github.com/mjurczyk.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# JSON Viewer\n\n### Pretty JSON viewer for your terminal\n\n![jsonviewer2](https://user-images.githubusercontent.com/9549760/31833904-59caaf0c-b5cc-11e7-8ccd-2d406e1bfd01.gif)\n\n\n___\n\n🚀 master ▶︎ \n[![npm version](https://badge.fury.io/js/json-viewer.svg)](https://badge.fury.io/js/json-viewer)\n[![CircleCI](https://circleci.com/gh/mjurczyk/json-viewer/tree/master.svg?style=svg)](https://circleci.com/gh/mjurczyk/json-viewer/tree/master)\n[![codecov](https://codecov.io/gh/mjurczyk/json-viewer/branch/master/graph/badge.svg)](https://codecov.io/gh/mjurczyk/json-viewer)\n\n🛠 develop ▶︎ \n[![GitHub version](https://badge.fury.io/gh/mjurczyk%2Fjson-viewer.svg)](https://badge.fury.io/gh/mjurczyk%2Fjson-viewer)\n[![CircleCI](https://circleci.com/gh/mjurczyk/json-viewer/tree/develop.svg?style=svg)](https://circleci.com/gh/mjurczyk/json-viewer/tree/develop)\n[![codecov](https://codecov.io/gh/mjurczyk/json-viewer/branch/develop/graph/badge.svg)](https://codecov.io/gh/mjurczyk/json-viewer)\n[![maintainer](https://img.shields.io/badge/maintainer-%40mjurczyk-brightgreen.svg)](https://github.com/mjurczyk)\n\n📚 dependencies ▶︎ \n[![dependencies Status](https://david-dm.org/mjurczyk/json-viewer/status.svg)](https://david-dm.org/mjurczyk/json-viewer)\n[![devDependencies Status](https://david-dm.org/mjurczyk/json-viewer/dev-status.svg)](https://david-dm.org/mjurczyk/json-viewer?type=dev)\n\n👀 code climate ▶︎ \n[![Code Climate](https://codeclimate.com/github/mjurczyk/json-viewer/badges/gpa.svg)](https://codeclimate.com/github/mjurczyk/json-viewer)\n[![Issue Count](https://codeclimate.com/github/mjurczyk/json-viewer/badges/issue_count.svg)](https://codeclimate.com/github/mjurczyk/json-viewer)\n\n___\n\n\u003e After only so many times of trying to recall a package script or dependency.\n\n`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.\n\n### Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage-basic)\n\t* [Basic](#usage-basic)\n\t* [Colors](#usage-colors)\n\t* [Piping \u0026 Redirection](#usage-piping--redirection)\n\t* [Always Color](#usage-always-color)\n\t* [Autocompletion](#usage-autocompletion)\n* [Contributing](#contributing)\n* [License](#license)\n\n### Installation\n\nTo use `json-viewer` you will need `node` environment installed on your system. With that ready, simply run:\n\n```bash\nnpm install --global json-viewer\n```\n\nYarn user? Not an issue:\n\n```bash\nyarn global add json-viewer\n```\n\nWith that done, you are ready to go - `json-viewer` just became available to you as a `json` command!\n\n### Usage: Basic\n\nThere are several ways to use `json-viewer` depending on your preferences. The most basic use case would be:\n\n```bash\njson package.json version # -\u003e \"2.0.0\"\n```\n\nIn 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!\n\n```bash\njson package.json keywords # -\u003e [ \"json\", \"viewer\", \"cli\" ]\n```\n\n### Usage: Colors\n\nTo add more readability, you can add `-c` or `--color` flag to the command:\n\n```bash\njson --color package.json dependencies\njson -c package.json dependencies\n```\n\nThis will add some styling to the output depending on its content.\n\n### Usage: Piping \u0026 Redirection\n\nHave 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:\n\n```bash\ncat package.json | json -c\n```\n\nWant to *go deeper*? We say **no** to compromise:\n\n```bash\ncat package.json | json -c version\n```\n\n*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.\n\n### Usage: Always Color\n\nUsing `-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:\n\n```bash\njson --always-color\n```\n\nAfter that, `json-viewer` will remember your setting automatically every time you call it!\n\n### Usage: Autocompletion\n\n*Note*: To use autocompletion see the installation instructions below! \n\n`json-viewer` uses an amazing `yargs` library to offer some helpful autocompletion to you. How does it work? Let us see:\n\n* Hitting `tab` key twice will list you all of the files in the current directory\n\n```bash\njson # tab-tab!\n\u003e package.json    index.js    src/    ...\n```\n\n* Hitting `tab` once will automatically finish the name of any fitting file in the current directory\n\n```bash\njson pa # tab!\njson package.json\n```\n\n* With a specified file, hitting tab twice will list you JSON properties in the file (Works great for nested properties as well!)\n\n```bash\njson package.json # tab-tab!\n\u003e name    keywords    scripts    dependencies    ...\n```\n\n* With a specified file, hitting tab once will automatically finish the name of the property\n\n```bash\njson package.json dep # tab!\njson package.json dependencies\n```\n\nYou can now traverse around your JSON structure in no time!\n\n#### Autocompletion Installation\n\nYou should be warned though - autocompletion does not come with `json-viewer` out of the box (not explicitly at least). To enable it, first use:\n\n```bash\njson completion\n```\n\nThis 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:\n\n```bash\njson completion \u003e\u003e ~/.bashrc\n# or (depending on your system):\njson completion \u003e\u003e ~/.bash_profile\n```\n\nThis 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.\n\nSave, reopen terminal, you are ready to go!\n\n\n### Contributing\n\nWant 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!\n\nEnlist 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:\n\n```bash\nnpm run build # build the /src directory and put the results into /lib\n\nnpm run start # build and run the latest /src\n\nnpm 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\n```\n\nTesting?\n\n```bash\nnpm run test # run tests once\n\nnpm run test:watch # run tests everytime anything in /src changes\n\nnpm run lint # test if your code looks nice and is consistent with the rest of the codebase\n\nnpm run coverage # see how much code is tested and how much is not\n\nnpm run coverage:html # generate HTML coverage report in /coverage/index.html\n```\n\nThere 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!\n\nKnowing 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!\n\n\n# License \nMIT :octocat:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjurczyk%2Fjson-viewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjurczyk%2Fjson-viewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjurczyk%2Fjson-viewer/lists"}