Tampered Console
Version 2
Version 2
  • Package Overview
  • Installation
  • Usage
    • Usage Overview
    • Global Console
      • Options
  • Features
  • Namespace
  • Debug
  • Formatting
  • Inspect
  • Acknowledgement
    • Depedencies
  • GitHub
    • Repository
    • Report Issues
  • License
Powered by GitBook
On this page

Was this helpful?

  1. Usage

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
PreviousUsage OverviewNextOptions

Last updated 3 years ago

Was this helpful?