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-extended

v1.3.0

Published

Extend console object with more formatting/display methods for ANSI colours in CLI & compat for Node.js --inspect

Downloads

23

Readme

console-extended

The goal is to extend the console object in Node.js for better readability/usability to logging in terminals. It adds methods to the console and uses and works well in combination with the colors module.

For example:

Usage

Install the module

npm install console-extended

Then require it in your Node.js code:

require('console-extended');

This will extend your console object with additional methods/properties.

Thus you can start using it:

console.header('foobar', 'Hello World!');

Methods

console.header(header, log...)

Currently it exports header method, which styles and pads the first argument as a "header". This is to help you signify from which sub-system a log was made from at a glance. Instead you could use it to log the date and time as well.

console.header('DNS', ipaddress, 'requested the DNS for', 'example.martin.dev');
console.header('App', 'The user uploaded a', 'photo');
console.header('Backup', 'I made a backup of the server at', '12am');
console.header('App', 'The user updated their profile');

The header takes the first argument, styles it and combines it with the other arguments in a call to console.log, but if you prefer, you can call the styling function on its' own:

var profilerHeader = console.ext.toHeader('Profiler');

This might be useful if you wish to use it for other console.* methods, such as time/timeEnd:

console.time(console.ext.toHeader('Backup') + ' for 12am');
// ...
console.timeEnd(console.ext.toHeader('Backup') + ' for 12am');

Examples

Here are some real-world examples I took from my localhost master server, as depicted with the example picture above:

console.header('DNS', 'Nameserver listening on', this.address());
console.header('DNS', 'Request of ', name,' by', request.address);
// ...
http.createServer(callback).listen(80, () => console.header('Web', 'Koa bound to ' + '*:80'.cyan));
https.createServer(options, callback).listen(443, () => console.header('Web', 'Koa bound to ' + '*:443'.red));
// ...
console.timeEnd(console.ext.toHeader('Profiler') + ' Configurations');
// ...
console.header('Web', 'Loading ' + servers.length.toString().bold.green + ' servers for ' + ('*.' + tld).blue + ' from ' + (root + '**').green);
// ...
console.log(
	console.ext.pad('‹' + Object.keys(config).filter((str) => str.length && !/(root)/.test(str)).join('·').replace('file', 'koa') + '›', 'right', 40).gray,
	(console.ext.pad(subdomain.bold, 'right', 40)).blue
	+  '.⎋'.blue + ' ⏤ '.dim + '⏣ '.green +
	console.ext.pad(config.root.replace(root, '/'), 'left', 30).green
);