Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including babel-plugin-transform-remove-console with all npm packages installed. Try it out:

var babelPluginTransformRemoveConsole = require("babel-plugin-transform-remove-console")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

babel-plugin-transform-remove-console v6.9.4

Remove all console.* calls.

babel-plugin-transform-remove-console

This plugin removes all console.* calls.

Example

In

console.log("foo");
console.error("bar");

Out

Installation

npm install babel-plugin-transform-remove-console --save-dev

Usage

Via .babelrc (Recommended)

.babelrc

// without options
{
  "plugins": ["transform-remove-console"]
}
// with options
{
  "plugins": [ ["transform-remove-console", { "exclude": [ "error", "warn"] }] ]
}

Via CLI

babel --plugins transform-remove-console script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["transform-remove-console"]
});

Options

  • exclude - An array of console methods to exclude from removal.
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free