no-console
v2.0.0
Published
Remove console.log() in production Environment.
Downloads
684
Readme
No console log
Remove console.log() in production Environment.
$ npm install no-console
Usage
Note: You need to set "NODE_DEBUG" environment variable to true when running node server in prod mode to see logs.
Example:
require('dotenv').config();
const express = require('express');
const noc = require('no-console') // require package
console.log('I will print');
const app = express();
noc(); // after this no log will be printed in prod mode if NODE_DEBUG is not set
console.log('I will not print in production mode');
app.listen(process.env.PORT || 3000, ()=>{
console.log("server is running");
});