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 🙏

© 2026 – Pkg Stats / Ryan Hefner

console.colourise

v0.0.5

Published

Adds colour functionality to console log

Readme

console.colourise

This is my console colour package. There are many like it but this one is mine.

It adds a number of functions to the console module for adding colour. You can specify text or background colours using specific functions, or you can change within a single call by specifying flags.

Usage

The generic coloured console log is console.col().

Coloured Text

To add coloured text, add flags with this structure @colourName@.

example:

console.col("@red@This text will be red")

Will output the text This text will be red in red.

Coloured Background

To add coloured background, add flags with this structure #colourName#.

example:

console.col("#blue#This text will have a blue background")

Will output the text This text will have a blue background in the default colour with a blue background.

Mixing Styles

You can combine background and text colours by using both background and text formatting.

example:

console.col("@red@#blue#This text will be red with a blue background")

Will output the text This text will be red with a blue background with red text on a blue background.

Changing styles

You can also change styles mid-text.

example:

console.col("@red@This text will be red @blue@This text will be blue") 

Will have This text will be red in red and This text will be blue in blue.

Clearing style

At any time you can clear the styling and return to your terminal defaults with either #clear# or @clear@. They both do the same thing.

example:

console.col("@red@This text will be red @clear@This text will be normal") 

Will have This text will be red in red and This text will be normal in your terminal's default colour.

Colour-specific functions

This package also adds a number of colour specific functions to console, one for each colour, both background and text.

Text Colour

Text colour functions follow this structure: console.colourName()

example:

console.red("Text is red");

Will output Text is red in red.

Background Colour

Text colour functions follow this structure: console.colourName$()

example:

console.blue$("Background is blue");

Will output Background is blue with a blue background.

Adding styles to colour-specific functions

These functions work the same as the regular console.col function.

example:

console.red("This text is red @yellow@This text is yellow")

Will have This text is red in red and This text is yellow in yellow.

Colours

The following colours are supported:

  • red
  • green
  • blue
  • yellow
  • magenta
  • cyan
  • white
  • black

and their darker variants

  • darkRed
  • darkGreen
  • darkBlue
  • darkYellow
  • darkMagenta
  • darkCyan
  • darkWhite
  • darkBlack

Additional Functionality

I added a few extra functions that I find useful in specific situations.

Die

console.die(msg) is a special function that takes a single string param, logs it in red, and then calls process.exit().

Enable/Disable

The package also exports enable() and disable(). When disabled, console.col just does nothing.