Strip console statements from a rocambole AST
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.jshintrc
.travis.yml
index.js
license
package.json
readme.md
test.js

readme.md

rocambole-strip-console Build Status

Strip console statements from a rocambole AST

Install

$ npm install --save rocambole-strip-console

Usage

const rocambole = require('rocambole');
const stripconsole = require('rocambole-strip-console');

rocambole.moonwalk('if (true) { console.log("foo"); }', node => {
	stripConsole(node);
}).toString();
//=> 'if (true) { void 0; }'

To prevent any side-effects, console.* is replaced with void 0 instead of being removed.

License

MIT © Sindre Sorhus