nc

no-console

Remove console.log() in production Environment.

Showing:

Popularity

Downloads/wk

5

Maintenance

No Maintenance Data Available

Package

Dependencies

0

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial