bbruno5 / debug-js

Debug library for nodeJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

debug-js

Simple debugger library for nodeJS

  • Install module:
    npm install https://github.com/bbruno5/debug-js.git

  • Import module:
    const debug = require('debug-js');
  • Usage:
    debug.level(lvl, var);

    lvl must be a number between 0 and 3. Defaults to 3.
    var must be the thing you want to print when debugging. A script, a text, etc.

    If you call debug.level() without arg, it will print a number in crescent order, until your script stop. Only works if debug level is set to 3.

  • Calling debug on script time execution:
    You must define DEBUG environment variable before call your script, defining a value between 0 and 3. Not defining it, means that its value will be false, and will take no effect.

    DEBUG=0|1|2|3 node ./yourcode.js yourargs

    DEBUG = 3 => prints all debug lines, from levels 0 to 3
    DEBUG = 2 => prints debug lines from levels 0 to 2
    DEBUG = 1 => prints debug lines from levels 0 to 1
    DEBUG = 0 => prints only debug lines from level 0
    DEBUG = false => turn off debug-js

About

Debug library for nodeJS

License:GNU Lesser General Public License v3.0


Languages

Language:JavaScript 100.0%