1.0.0 • Published 6 years ago

debuggler v1.0.0

Weekly downloads
832
License
BSD-3-Clause
Repository
-
Last release
6 years ago

debuggler

Build Status Code Climate Test Coverage

debuggler is a visionmedia/debug wrapper that is able to resolves it's caller path and package.json information, so it needs no configuration.

Install

$ npm install debuggler

Usage

/**
 * /home/example/package.json 
 *   name: example
 *   version: 1.0.0
 * /home/example/foo/bar.js
 */
process.env.DEBUG = 'example*';

const debug = require('debuggler')({ version: true });

debug('I know where I am!');
// Should output: example@1.0.0:foo:bar I know where I am!

API

ArgumentTypeDefault ValueDescription
optionsString|Object{}Debug namespace string or an options object.
options.namespaceStringundefinedNamespace is just passed to debug module, other options are ignored.
options.nameStringtrueProject name or true to get it from package.json.
options.versionString|BooleanfalseVersion string or true to get it from package.json.
options.verSeparatorString'@'Version separator character.
options.dirSeparatorString':'Directory separator character.
options.fileString|BooleantrueFile name or true to get the current one.
options.extString|BooleanfalseFile extension or true to get the current one.

License

Licence © Rodrigo Gomes da Silva