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

typhonjs-color-logger

v0.0.13

Published

Provides ANSI color logging.

Readme

typhonjs-color-logger

NPM Documentation Code Style License Gitter

Build Status Coverage Dependency Status

Provides a color coded logger for ANSI terminal usage. In addition to providing a global scope logger typhonjs-color-logger is optionally plugin enabled via typhonjs-plugin-manager and can self-register on an eventbus with all methods exposed as event bindings.

In the future an option to use CSS colors for browser usage will be enabled.

There are several format options to display additional data / info including location where the log method is invoked in addition to a time stamp. By default the time stamp option is disabled.

When passing in an Error for logging the stack trace of the error will be used for info and trace creation. The trace method will automatically generate a stack trace.

format: [LogLevel] [Time] [File] log text

Log level and color:

  • fatal: light red
  • error: red
  • warn: yellow
  • info: green
  • debug: blue
  • verbose: purple
  • trace: light cyan

Each log method for the log levels above have two alternate versions that are accessed by appending Compact, NoColor or Raw to the method name. Or if using event bindings appending :compact, :nocolor or :raw. The no color option with, well, no color outputting the message with the current log format and the raw format will output just the raw message with no format or color applied.

In addition trace inclusive and exclusive regexp filtering is available to eliminate spurious code removing it from the stack trace. By default the typhonjs-color-logger and backbone-esnext-events is excluded from trace results. Additionally the following events from typhonjs-plugin-manager are handled to automatically add and remove trace filters from plugins added & removed via the event bindings: typhonjs:plugin:manager:added:plugin, typhonjs:plugin:manager:plugin:changed:eventbus, and typhonjs:plugin:manager:removed:plugin. To skip auto filter registration for a particular plugin set logAutoFilter to false in the associated plugins options.

A simple example:

import logger from 'typhonjs-color-logger';

// simple usage
logger.error('An error occurred!');

Example typhonjs-plugin-manager usage:

import PluginManager    from 'typhonjs-plugin-manager';
import eventbus         from 'backbone-esnext-eventbus';

const pluginManager = new PluginManager({ eventbus });

// This will automatically wire up typhonjs-color-logger to the eventbus.
pluginManager.add({ name: typhonjs-color-logger });

// simple usage
eventbus.trigger('log:error', 'An error occurred!');

Please see:

  • https://www.npmjs.com/package/typhonjs-plugin-manager
  • https://www.npmjs.com/package/backbone-esnext-eventbus