consoleify

1.1.3 • Public • Published

NPM Version Build Status

consoleify

browserify transform to inject a custom console object that prefix the calls to it with the name of the module itself

Overview

This transform will turn this:

//my-module.js
var someFunc = function () {
  console.log('hello');
};
module.exports = someFunc;

Into this:

/*wrapping console start!*/
var console = require('consoleify/console-wrapper').create("dummy2");
/*wrapping console end!*/
 
var someFunc = function () {
};
module.exports = someFunc;

So console methods calls are prefixed by the module where the call was done, for easy tracking/filtering of logs

the consoleify/console-wrapper module is also part of this module

Install

npm i --save-dev consoleify

Usage

var consoleify = require( 'consoleify' );

var b = browserify();
b.add('./my-module');
b.transform( consoleify );
b.bundle().pipe(process.stdout);

License

MIT

Changelog

Changelog

Package Sidebar

Install

npm i consoleify

Weekly Downloads

3

Version

1.1.3

License

MIT

Last publish

Collaborators

  • royriojas