1.1.5 • Published 9 years ago

console-filter v1.1.5

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

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