# beautify-json

> Beautify JSON with colors and indentation and print it on terminal

Latest version **1.0.1** (published 2019-09-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install beautify-json
pnpm add beautify-json
yarn add beautify-json
bun add beautify-json
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-09-29 |
| First published | 2019-09-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 167.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Nikhil Kumaran S |
| Maintainers | nikhil-kumaran |
| Keywords | json, json-beautify, beautify, json-prettify, prettify, json-formatter |

## Links

- npm: https://www.npmjs.com/package/beautify-json
- Repository: https://github.com/Nikhil-Kumaran/beautify-json
- Homepage: https://github.com/Nikhil-Kumaran/beautify-json#readme
- Issues: https://github.com/Nikhil-Kumaran/beautify-json/issues
- npm.io page: https://npm.io/package/beautify-json

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^2.4.2

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-09-29
- 1.0.0 — 2019-09-29

## README

# beautify-json

Beautify JSON with colors and indentation and print it on terminal

## Installation

```bash
npm install beautify-json
```

## Usage

```javascript
const { jsonBeautify } = require('beautify-json')

let your_object = {
    name: 'Nikhil',
    age: 22,
    isMarried: false,
    girlfriends: null,
    interestedIn: [
        'javascript',
        'reactjs',
        'nodejs'
    ]
}

jsonBeautify(your_object) //It will beautify your object with colors and proper indentation and display it on the terminal
```

![Screenshot of your object displayed on the terminal](./assets/SS1.png)

## Why choose beautify-json?

Minimal footprint. The only dependency that I used is `chalk` for colors.

The underlying approach is to use `JSON.stringify`. I have also added a condition to treat regular expressions as strings, else `JSON.stringify` will serialize them as empty objects.

---
_Source: https://npm.io/package/beautify-json · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
