@patarapolw/prettyprint

This project shows how we can prettyprint beyond JSON.stringify(obj, null, 2) in Node.js

Usage no npm install needed!

<script type="module">
  import patarapolwPrettyprint from 'https://cdn.skypack.dev/@patarapolw/prettyprint';
</script>

README

prettyprint

This project shows how we can prettyprint beyond JSON.stringify(obj, null, 2) in Node.js

  • With colors
  • Multiline strings

As for the core code, you are free to copy the code from /src/index.ts.

Local installation

npm i @patarapol/prettyprint --dev
import { pp } from '@patarapolw/prettyprint'
pp(OBJECT)

CLI installation

Run it directly with npx

npx github:patarapolw/prettyprint OBJECT_AS_JS_EVAL

Or, install as global

npm i -g @patarapolw/prettyprint
pp OBJECT_AS_JS_EVAL