0.1.1 • Published 10 years ago

js-debug v0.1.1

Weekly downloads
1
License
-
Repository
github
Last release
10 years ago

js-debug

javascript debugging utility

Build Status NPM Version

install

npm install --save js-debug

usage

var debug = require('js-debug');

var debugA = debug('debuggerA');
debugA('LogA');
// debuggerA +0ms LogA

var debugB = debug('debuggerB');
setTimeout(function () {
  debugB('LogB');
}, 100);
// debuggerB +100ms LogB

debug.json

debug.json in project's root directory is used to config which debuggers should be printed to the console.

print all:

{
  "debug": true
}

print none:

{
  "debug": false
}

print debuggerA:

{
  "debug": ["taskA"],
  "tasks": {
    "taskA": ["debuggerA"]
  }
}

print debuggerA, debuggerB and debuggerC:

{
  "debug": ["taskA", "taskB"],
  "tasks": {
    "taskA": ["debuggerA"],
    "taskB": ["debuggerB", "debuggerC"]
  }
}
0.1.1

10 years ago

0.1.0

10 years ago