https://github.com/TopCli/Pretty-JSON
Stdout JSON in your terminal
https://github.com/TopCli/Pretty-JSON
Last synced: 5 months ago
JSON representation
Stdout JSON in your terminal
- Host: GitHub
- URL: https://github.com/TopCli/Pretty-JSON
- Owner: TopCli
- License: mit
- Created: 2019-04-30T19:45:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-01T06:15:39.000Z (about 1 year ago)
- Last Synced: 2024-05-14T07:07:25.703Z (11 months ago)
- Language: JavaScript
- Size: 56.6 KB
- Stars: 1
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-crafted-nodejs - @slimio/pretty-json - Stdout JSON in your terminal with colors and syntax close to yml. (Packages / CLI (TTY etc..))
README
# pretty-json

[](https://github.com/TopCli/Pretty-JSON/commit-activity)
[](https://github.com/TopCli/Pretty-JSON/blob/master/LICENSE)
[](https://api.securityscorecards.dev/projects/github.com/TopCli/Pretty-JSON)
Stdout JSON in your terminal with colors. This package has been created to stdout clean and beautiful JSON in the SlimIO CLI.
## Requirements
- [Node.js](https://nodejs.org/en/) v16 or higher## Getting Started
This package is available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).
```bash
$ npm i @topcli/pretty-json
# or
$ yarn add @topcli/pretty-json
```## Usage example
```js
import prettyJSON from "@topcli/pretty-json";prettyJSON({
foo: "bar",
hello: "world!",
arr: [1, 2, 3]
});
```It will produce the following stdout:

## API
### prettyJSON(obj: object): void
Stdout a given JSON Object (Plain Object, Objects Prototype of Object or Array).## Dependencies
|Name|Refactoring|Security Risk|Usage|
|---|---|---|---|
|[@slimio/is](https://github.com/SlimIO/is)|Minor|Low|Type checker|
|[kleur](https://github.com/lukeed/kleur)|Minor|Low|TTY color|## License
MIT