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

concol

v2.1.1

Published

Node.js color console logger

Readme

ConCol

A simple but flexible Node.js formatted color logger with no dependencies.

By default, time is shown in 24-hour HH:MM:SS.mmm and numbers are shown in #,### format.

Installation

npm install ConCol

Usage

import { ConCol } from 'ConCol';

// create logger instances
const log1 = new ConCol('App One', 'cyan');
const log2 = new ConCol('App Two', 'green');
const log3 = new ConCol('App Three 0123456789', 'white', 3);

// basic logging
log1.log('output single string');
log1.info('output string\nwith carriage returns');
log1.warn('show warning');
log1.error('show error');

/* output
12:30:07.030 App One       ┃ output a single string
10:54:34.645 App One       ┃ output string
10:54:34.645 App One       ┃ with carriage returns
10:54:34.646 App One       ┃  WARN: show warning
10:54:34.646 App One       ┃ ERROR: show error
*/

// name/value/unit
log2.log(['ConCol requires', 0, ' modules']);
log2.log([ 'fibonacci sequence', ['first', 1], ['second', 1], ['third', 2] ]);

/* output
10:54:34.697 App Two       ┃                ConCol requires:        0 modules
10:54:34.697 App Two       ┃ output the fibonacci sequence
10:54:34.697 App Two       ┃                          first:        1
10:54:34.697 App Two       ┃                         second:        1
10:54:34.697 App Two       ┃                          third:        2
*/

// log level filtering
log3.info('level0', 0);
log3.info('level3', 3);
log3.info('level4', 4); // not shown - log level set to 3

/* output
10:54:34.748 App Three 0123┃ level0
10:54:34.748 App Three 0123┃ level3
*/

API

new ConCol(appName, color, levelShow)

Creates a new logger instance.

  • appName (string): the application/namespace name (optional)
  • color (string): base text color: black, red, green, yellow, blue, magenta, cyan, white, gray (default: white)
  • levelShow (number): the maximum log level to output, so 0 is silent/important only (default: Infinity - shows everything)

The following methods are available.

log(msg, level)

Outputs console.log() messages.

  • msg (undefined|string|Array): the message (optional)
  • level (string|Array): message logging level (default 0)

The msg can be any of:

  • a string
  • a string with carriage returns (outputs to separate lines)
  • a [name, value, unit] array, e.g. ['errors', 0, ' found']
  • an array containing strings or [name, value, unit] arrays

info(msg, level)

Outputs console.info() messages. Parameters are identical to log().

warn(msg, level)

Outputs console.warn() messages prefixed with "WARN:". Parameters are identical to log().

error(msg, level)

Outputs console.error() messages prefixed with "ERROR:". Parameters are identical to log().

Advanced configuration

The following static properties configure log layout:

  • ConCol.appSize = <num> - the width of the appName column (default 14)
  • ConCol.nameSize = <num> - the width of a name column (30)
  • ConCol.valueSize = <num> - the width of a value column (10)
  • ConCol.numFormat = <Intl.NumberFormat> - numeric value object (#,### rounded to 0dp)
  • ConCol.timeFormat = <Intl.DateTimeFormat> - date/time object (HH:MM:SS.mmm)
// example
ConCol.appSize = 7;
ConCol.nameSize = 15;
ConCol.valueSize = 10;

// show values in #,###.## format
ConCol.numFormat = new Intl.NumberFormat(
  'en-US',
  { minimumFractionDigits: 2, maximumFractionDigits: 2 }
);

// show dates in DD/MM HH:MM:SS format
ConCol.timeFormat = new Intl.DateTimeFormat(
  'af-AF',
  {
    month: '2-digit', day: '2-digit',
    hour: '2-digit', minute: '2-digit', second: '2-digit'
  }
);

const cc = new ConCol('App One', 'yellow');

cc.log([ 'number two', 12345.678 ]);
cc.log([ 'number one', 123 ]);

/* output
05-06 13:18:20 App One┃      number two:  12,345.68
05-06 13:18:20 App One┃      number one:     123.00
*/