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 🙏

© 2024 – Pkg Stats / Ryan Hefner

debug-color2

v1.3.2

Published

colorize console log, this module can work with require('debug')

Downloads

6,330

Readme

debug-color2

colorize console log, this module can work with require('debug')
  1. same api with console
  2. can work with debug

demo.png

demo

API

export interface IOptions
{
	/**
	 * enable log display or not
	 */
	enabled?: boolean,

	/**
	 * show label string
	 */
	label?: boolean | string[],

	/**
	 * show time label
	 */
	time?: boolean,

	/**
	 * set default inspectOptions
	 */
	inspectOptions?: util.InspectOptions,

	/**
	 * set color style
	 */
	colors?: {
		debug?,
		error?,
		info?,
		log?,
		trace?,
		warn?,
		success?,
		ok?,
		[k: string]: string | Chalk | IChalkLike,
	},

	/**
	 * check is node.js console
	 */
	readonly stream?: boolean,
}
import ConsoleColorize, { Console } from 'debug-color2';

let options = {
    time: true,
    label: true,
};

let c1;
c1 = new Console();
c1 = new Console(console);
c1 = new Console(console, options);

c1 = ConsoleColorize.console
let c1 = new Console2();

c1.blue('blue');
c1.blue.log('blue.log');

c1.cyan.bgWhite('cyan.bgWhite');

c1.red.info('red.info');

c1.blue.debug('blue.debug');
c1.blue.error('blue.error');
c1.cyan.bgWhite.warn('cyan.bgWhite.warn');

c1.blue.success('blue.success');
c1.blue.ok('blue.ok');
//
c1.underline.info('underline.info');
c1.underline.bold.info('underline.bold.info');
c1.underline.bold.inverse.info('underline.bold.inverse.info');

c1.magenta.withOptions({
	time: true,
}).log('magenta.log');

c1.magenta.exception('magenta.exception');

let c2 = c1.magenta.withOptions({
	enabled: debug('test').enabled
});

console.log('DEBUG=test is', debug('test').enabled);

c2.log('this show when DEBUG=test or DEBUG=*');

console.log('----------------------');

c1.setOptions({
	label: true,
	time: true,
});

c1.log('log');
c1.assert(true, 'assert');

c1.debug('debug');
c1.info('info');

c1.exception('exception');
c1.error('error');
c1.warn('warn');

c1.success('success');
c1.ok('ok');
c1.fail('fail');

demo.png

demo2.png