Node Debug Tool
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 = 'Foo:bar:x'; var abc = 'foo:bar:y'; var abcd = 'foo:abc'; var abcde = 'other'; ab; abc; abcd; other;
The code above possible outputs:
- 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
- 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
- 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
- in case of running with
DEBUG_MODE=foo:bar:x
:
[Foo:Bar:X] [Debug] "Some foo bar x" +0ms