node package manager


Extends default console logging with various utilities.


Extends default console logging with various utilities.


  • Prepend timestamp to output using Moment.js' format
  • Prepend log level (ie, log, inf, war, err)
  • Attach events to be called when something is logged using any of the 4 log functions


First install it using npm

npm install extended-console

Then simply require it and log away!


console.log("Log away!");


Options are located within the console.extended object.

  • showTimestamp ( boolean ) Whether to prepend a timestamp to output
  • timestampFormat ( string ) Format for timestamp. Uses Moment.js' format
  • showLogLevel ( boolean ) Whether to prepend the log level to output

For example


console.extended.timestampFormat = "YYYY-MM-DD HH:mm";
console.log("Custom timestamp format!");


This module extends the console to act as a standard event emitter. You can use standard events.EventEmitter methods such as .on and .addListener on the console.extended object. The event names are as follow: log, inf, war, err. Be careful not to call any of the logging functions inside of an event callback for that logging function itself, for it will result in a stack overflow.


console.extended.on("err", function() {
	process.stdout.write("Error event listener called\n");
console.error("Error event listener test");


  • Events now called with potential prepended string in arguments
  • No longer prepend empty string (used to produce superfluous space character)
  • Fixed bug that caused events not to be emitted
  • Added event support
  • Changed log level logging to use following short names: log, inf, war, err. This is for consistency with events
  • Changed to using Semantic Versioning. Changed version numbers to reflect what should have been in this README file.

(previously 0.2)

Breaking changes

  • Added option to prepend log level (on by default)
  • Switched to Moment.js for date formatting
  • Surrounding brackets are no longer part of timestamp format. They are always automatically there

(previously 0.1)

  • Initial release


MIT (see included LICENSE)