Skip to content

TopCli/Pretty-JSON

Repository files navigation

pretty-json

version Maintenance mit OpenSSF Scorecard build

Pretty-print JSON to the terminal with syntax highlighting and structure-aware formatting.

Requirements

Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn.

$ npm i @topcli/pretty-json
# or
$ yarn add @topcli/pretty-json

Usage example

import prettyJSON from "@topcli/pretty-json";

prettyJSON({
  foo: "bar",
  hello: "world!",
  arr: [1, 2, 3]
});

It will produce the following stdout:

stdout

API

prettyJSON(obj: object): void

Prints a JSON-compatible object or array to the terminal with syntax highlighting and structured indentation.

  • Supports plain objects, arrays, and nested structures.
  • Skips functions and symbols.
  • Color-codes data types (strings, numbers, booleans, etc.).
  • Outputs readable, formatted JSON — ideal for CLI inspection.

License

MIT

About

Stdout JSON in your terminal

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 7