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
  • Instantiated Console
  • Global Console

Was this helpful?

Namespace

Namespaces helps you track your console. It's concatenated to the prefix to label what is being printed to the console. There are multiple ways to enable the namespace feature.

Instantiated Console

const Console = require('tampered-console');
new Console('namespace').log(args);

Global Console

Individual Namespace

There is an option where the global console can be labeled individually. If this is enabled, the console method will have to be invoked twice as it returns a function. First for the namespace and next for the arguments.

index.js
const Console = require('tampered-console');
Console.globalConsole({ namespace: true });
app.js
console.log('namespace')(args);

Uniform Namespace

Uniform namespace labels your console every time it logs.

There are two ways to achieve a uniform namespace. First is to pass the namespace as string in the globalConsoleor pass the namespace as namespace property value.

const Console = require('tampered-console');
Console.globalConsole('namespace');
const Console = require('tampered-console');
Console.globalConsole({ namespace: 'namespace' });

PreviousOptionsNextDebug

Last updated 3 years ago

Was this helpful?