Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Strip console statements from a rocambole AST

License

Notifications You must be signed in to change notification settings

sindresorhus/rocambole-strip-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

The Rocambole project is no longer maintained.


rocambole-strip-console Build Status

Strip console statements from a rocambole AST

Install

$ npm install 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