jprettify
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

jPrettify


A 0.5kb library to pretty print json objects for users

Nice things

  • 0.5kb
  • 0 dependencies

The gist of it

const jPrettify = require("jprettify").default;
import jPrettify from "jprettify";

const result = jPrettify({
    a: {
        b: "c",
        d: [1, 2],
    },
});

console.log(result);
// a:
//   b:
//     - c
//   d:
//     - 1
//     - 2

API

export default function jPrettify(input: Input, spaces = 2): string;
// spaces: the amount of whitespace to add to every layer

Package Sidebar

Install

npm i jprettify

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

4.82 kB

Total Files

5

Last publish

Collaborators

  • tronikel