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

debugmessage

v1.1.4

Published

write console message colored

Readme

Description

debugmessage is a simple module for node.js that provides utility to write colored command line in debug nodejs script

Requirements

Install

npm install debugmessage

Examples

  • simple base method to write cmd message colored (es6)
import {DebugMessage} from "debugmessage";
let log=new DebugMessage();
log.debug("this is only a debug");
log.command("this is only a command");
log.error("this is a error");

write on console

[DEBUG] this is only a debug
[COMMAND] this is only a command
[ERROR] this is only a error

DEBUG is a cyan foreground color COMMAND is a yellow foreground color ERROR is a red foreground color

description

module debugmessage use ansi colors to colorize the console log label on squares. Each color is a single method write it in lowercase

Foreground colors

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

Background colors

  • bgblack
  • bgred
  • bggreen
  • bgyellow
  • bgblue
  • bgmagenta
  • bgcyan
  • bgwhite
import {DebugMessage} from "debugmessage";
let log=new Message();
let green=log.green("message green");
console.log(green);//normal console but colored
//or you can print with module
log.printMessage("message","green");
//use background color green
log.printMessage("message","bggreen");
//-------------------------
// simple test
log.test();

npm run test (grunt run:test)

Alt text

API

Events

Property

  • print< boolean >: show/hide message in commandline

Methods

  • (constructor)() - Creates the dynamic sequences colors method.

  • addLabel(labelstring:string,color:string):string

    • DESCRIPTION: create new method lowercase to write message with [LABEL]. the name of method is the LABEL in lowercase.(see example)
      • labelstring - new label
      • color - one of foreground or background. Default: cyan
  • message(message:string,color:string):string

    • DESCRIPTION: return colored string
      • message - message to message to color. Default: null
      • color - one of foreground or background. Default: cyan
  • info(message:string,stack...): void

    • DESCRIPTION: write in cmd a colored message with prefix label "INFO" blue
      • message - message to message to color. Default: null
      • stack - message to append with label [INFO STACK] ...
  • event(message:string,stack...): void

    • DESCRIPTION: write in cmd a colored message with prefix label "EVENT" blue
      • message - message to message to color. Default: null
      • stack - message to append with label [EVENT STACK] ...
  • debug(message:string,stack...): void

    • DESCRIPTION: write in cmd a colored message with prefix label "DEBUG" cyan
      • message - message to message to color. Default: null
      • stack - message to append with label [DEBUG STACK] ...
  • command(message:string): void

    • DESCRIPTION: write in cmd a colored message with prefix label "COMMAND" yellow
      • message - message to message to color. Default: null
      • stack - message to append with label [COMMAND STACK] ...
  • error(message:string): void

    • DESCRIPTION: write in cmd a colored message with prefix label "ERROR" red. Error message have line before and after the message.
      • message - message to message to color. Default: null
      • stack - message to append with label [ERROR STACK] ...
  • printMessage(message:string,color:string):void

    • DESCRIPTION: print in cmd the colored message
      • message - message to message to color. Default: null
      • color - one of foreground or background. Default: cyan

Extend before 1.1.4

class Message extends DebugMessage{
	constructor(){super();}
	error(m,...p){
		super.error(m,...p);
		process.exit();//this lock node process
	}
	warning(message){
		this.printMessage(message,"bgyellow");
	}
	event(message){
		let label = this._msglabel_("EVENT", "magenta");
		this.printMessage(`${label} ${message}`);
	}
}

Extend after >=1.1.4

mymessage= new DebugMessage();
mymessage.addLabel("labelCustom","bgyellow");
mymessage.labelcustom("a new custom label");

CHANGE LOG

  • 1.1.4 added the dynamic addition to create label
    • new label message "info" e "event"
  • 1.1.3 fix on documentation