Global Console

Overriding the global console.

Tampered Console tampers the global console. This eases you from requiring the package in every script. Instead, require it once in your main script and call the override option Console.globalConsole(). You can then use the global console as you normally would and the console flavor will be applied.

In your main script, require the package once and call the globalConsole function then in any of your script, just use the global console.

Main Script (index.js)

/* main script */
const Console = require('tampered-console');
Console.globalConsole(true);

Other Subsequent Script

/* other script */
console.log('hello world');
// require('tampered-console'); is no longer needed

Last updated