Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dev-console

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dev-console

disable window console log functions in production mode. Edit

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

dev-console

disable window console log functions in production mode.

This is just a simple wrapper for window console functions, make them dump in production mode.

Install

<script src="https://cdn.rawgit.com/minhlucvan/dev-console/master/console.js"></script>
<script>
  window.DEBUG = true;
  console.log("oh, is is the DEBUG mode."); // working as normal
  
  window.DEBUG = false;
  console.log("oh, is is not the DEBUG mode."); //nothing be logged
 
</script>

Supported functions

I wrapped console.log and console.debug functions, the other such as console.warn, console.info console.errorare working as normal.

Force logging

In case you want to log in production mode you can use console.flog and cosole.fdebug to call the original functions.

happy coding :heart:

Keywords

FAQs

Package last updated on 17 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc