1.1.3 • Published 10 years ago

consoleify v1.1.3

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

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

1.1.3

10 years ago

1.1.2

10 years ago

1.1.0

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago