biofriction-wp-theme/node_modules/lazy-debug-legacy
jorge a7910c81a8 moved to new repo 2021-10-26 14:18:09 +02:00
..
src moved to new repo 2021-10-26 14:18:09 +02:00
.npmignore moved to new repo 2021-10-26 14:18:09 +02:00
LICENSE.md moved to new repo 2021-10-26 14:18:09 +02:00
README.md moved to new repo 2021-10-26 14:18:09 +02:00
package.json moved to new repo 2021-10-26 14:18:09 +02:00

README.md

lazy-debug

npm lazy-debug

Node.js module which generates app & module names for visionmedia´s debug using __filename and package.json.

Basic usage example:

var debug = require('lazy-debug-legacy').get(__filename);

Depending on __filename, debug name will be something like packageName:dir:file. File extension is removed and if file name is index, its removed too. For futher customization, to fit better for project structure, you can provide filter function:

var lazyDebug = require('lazy-debug-legacy');
lazyDebug.configure({filter: function (pathArray) {
  if ( pathArray[0] === 'src' ) {
    pathArray.shift();
  }
  return pathArray;
}});

// now, when called in packageRoot/src/module1/index.js
var debug = require('lazy-debug-legacy').get(__filename);
// debug name will be projectName:module1

Install

npm install --save debug lazy-debug

Tests

npm test

License

The MIT License