node-debug-tool

0.1.9 • Public • Published

Node Debug Tool

Build Status

Tiny node.js debugging tool with colors and timing functionality

Table of contents

Installation

 $ npm install node-debug-tool

Usage

The DEBUG_MODE environment variable, must be set to a namespace in order to see the debugging information.

Code example:

 
  var ab = require('../lib/node-debug-tool')('Foo:bar:x');
  var abc = require('../lib/node-debug-tool')('foo:bar:y');
  var abcd = require('../lib/node-debug-tool')('foo:abc');
  var abcde = require('../lib/node-debug-tool')('other');
 
  ab.log('Some foo bar x');
  abc.log('Some foo bar y');
  abcd.log('Some foo abc');
  other.log('Some other');

The code above possible outputs:

  1. in case of running with DEBUG_MODE=*:
   [Foo:Bar:X] [Debug] "Some foo bar x"  +0ms
   [Foo:Bar:Y] [Debug] "Some foo bar y"  +0ms
   [Foo:Abc] [Debug] "Some foo abc"  +0ms
   [Other] [Debug] "Some other"  +0ms
  1. in case of running with DEBUG_MODE=foo:*:
   [Foo:Bar:X] [Debug] "Some foo bar x"  +0ms
   [Foo:Bar:Y] [Debug] "Some foo bar y"  +0ms
   [Foo:Abc] [Debug] "Some foo abc"  +0ms
  1. in case of running with DEBUG_MODE=foo:bar:*:
   [Foo:Bar:X] [Debug] "Some foo bar x"  +0ms
   [Foo:Bar:Y] [Debug] "Some foo bar y"  +0ms
  1. in case of running with DEBUG_MODE=foo:bar:x:
   [Foo:Bar:X] [Debug] "Some foo bar x"  +0ms

Package Sidebar

Install

npm i node-debug-tool

Weekly Downloads

0

Version

0.1.9

License

MIT

Last publish

Collaborators

  • danrevah