unconsole
v1.0.0
Published
Prevent console logs in JavaScript
Downloads
4
Maintainers
Readme
⚙️ Installation
npm i unconsole
📘 Usage
→ Import
// commonjs
const unconsole = require("unconsole");
// ES6
import unconsole from "unconsole";
→ Disable all console methods
import unconsole from "unconsole";
unconsole();
// Test it!
console.log('console.log');
console.warn('console.warn');
→ Disable specific console methods
import unconsole from "unconsole";
unconsole(["log", "info"]);
// Test it!
console.log('console.log');
console.info('console.info');
console.warn('console.warn');
To hide specific console methods like console.log()
and console.info()
, simply provide an array of method names to disable. For disabling only one method, use an array with a single string like ["log"]