console-filter
v1.1.5
Published
browserify transform to remove calls to console methods that do not match the given filter
Downloads
4
Maintainers
Readme
console-filter
browserify transform to remove calls to console methods that do not match the given filter
Overview
This transform will turn this:
//my-module.js
var someFunc = function () {
console.log('some-value: here', 1);
console.log('my-prefix: hello');
};
module.exports = someFunc;
Into this:
//my-module.js
var someFunc = function () {
console.log('my-prefix: hello');
};
module.exports = someFunc;
when configured with a filter like my-prefix
.
var console-filter = require( 'console-filter' ).configure({
keep: 'my-prefix'
});
Install
npm i --save-dev console-filter
Usage
var console-filter = require( 'console-filter' ).configure({
keep: 'my-prefix'
});
var b = browserify();
b.add('./my-module');
b.transform( console-filter );
b.bundle().pipe(process.stdout);