Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 1.11 KB

README.md

File metadata and controls

54 lines (42 loc) · 1.11 KB

NPM Version Build Status

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);