no-console

2.0.0 • Public • Published

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");
    });

Readme

Keywords

none

Package Sidebar

Install

npm i no-console

Weekly Downloads

63

Version

2.0.0

License

ISC

Unpacked Size

1.06 kB

Total Files

4

Last publish

Collaborators

  • abhi11210646