npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

json-chalkify

v1.0.2

Published

This package is a very simple, 1 dependancy, extension to the chalk package. It is designed to format and display javascript objects and JSON in the terminal.

Downloads

859

Readme


       _  _____  ____  _   _    _____ _           _ _    _  __       
      | |/ ____|/ __ \| \ | |  / ____| |         | | |  (_)/ _|      
      | | (___ | |  | |  \| | | |    | |__   __ _| | | ___| |_ _   _ 
  _   | |\___ \| |  | | . ` | | |    | '_ \ / _` | | |/ / |  _| | | |
 | |__| |____) | |__| | |\  | | |____| | | | (_| | |   <| | | | |_| |
  \____/|_____/ \____/|_| \_|  \_____|_| |_|\__,_|_|_|\_\_|_|  \__, |
                                                                __/ |
                                                               |___/ 

example

JSON Chalkify

This package is a very simple, 1 dependancy, extension to the chalk package.

It is designed to format and display javascript objects and JSON in the terminal.

Install

  npm install json-chalkify

Usage

import JSONChalkify from 'json-chalkify'

const chalkify = new JSONChalkify().chalkify

console.log(chalkify({myThing: 42}))

Default values

json-chalkify has these values by default, but all of them are configurable, explained in the configuration section.

| Resource | Type | Default| | ------------- |:-------------:|:-----:| | propertyColor | chalk color | chalk.blue | | colonColor | chalk color | chalk.blue | | bracketColor | chalk color | chalk.white | | booleanColor | chalk color | chalk.green | | stringColor | chalk color | chalk.yellow | | numberColor | chalk color | chalk.red | | undefinedColor | chalk color | chalk.gray | | nullColor | chalk color | chalk.gray | | functionColor | chalk color | chalk.white | | symbolColor | chalk color | chalk.cyan | | bigintColor | chalk color | chalk.blueBright | | emptyLinesBefore | int | 1 | | emptyLinesAfter | int | 0 | | spacingChar | string | " " | | offsetOfSpacingChars | int | 0 | | numOfSpacingChars | int | 2 | | maxLengthBeforeTruncate | int | 100 | | afterTruncateString | string | " ..." |

Configuration

Creating a chalkify instance with a custom configuration is quite simple. Just pass in an object of values which should deviate from the default.

import chalk from 'chalk'
import JSONChalkify from 'json-chalkify'

const chalkifyConfig = {
  propertyColor: chalk.red
}

const chalkify = new JSONChalkify(chalkifyConfig).chalkify

Configuration Examples

Since the chalkify instance is simply expecting an object of values deviating from the default, you're free to be creative in how you choose to implement this into your project.

For example you could have different color schemes for different node enviornments to see at a glance which logs belong to which env.


import chalk from 'chalk'
import JSONChalkify from 'json-chalkify'

const devChalkifyConfig = {
  propertyColor: chalk.red
}

const stagingChalkifyConfig = {// determine which to use based on process.env.NODE_ENV
  propertyColor: chalk.green
}

const devChalkify = new JSONChalkify(devChalkifyConfig).chalkify
const stagingChalkify = new JSONChalkify(stagingChalkifyConfig).chalkify