You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

depugger

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depugger

small debugging utility

1.0.0
latest
Source
npm
Version published
Maintainers
1
Created
Source

node-depugger Build Status

NPM

NPM

Depugger is a small lib that provides a debugging utility.

Installation

$ npm install depugger

depugger([debug, [name]]), depugger(options)

depugger returns a function that supports all of the util.format features and outputs debug messages based on the initial configuration.

  • debug: specifies if logged messages should be outputted, optional, default: false
  • name: a category key that will prepend every message, optional, default: ""
  • options: options hash that can be used to submit all of the above parameters at once
var depugger = require('depugger');

var debug = depugger(true, 'fooDebugger');

debug('foo');
debug('bar "%s"', 'bax');
debug('spam %d eggs', 10);

//output to console:
//[fooDebugger] foo
//[fooDebugger] bar "bax"
//[fooDebugger] spam 10 eggs

Alternatively all parameters can be specified via an options hash:

var depugger = require('depugger');

var debug = depugger({debug: true, name: 'fooDebugger'});

debug('foo');
debug('bar "%s"', 'bax');
debug('spam %d eggs', 10);

//output to console:
//[fooDebugger] foo
//[fooDebugger] bar "bax"
//[fooDebugger] spam 10 eggs

depugger.child(childName)

Creates a child instance. The name of the parent's debugger will be concatenated with the childDebugger's name:

var depugger = require('depugger');

var debug = depugger({debug: true, name: 'fooDebugger'});

var childDebug = debug.child('child');

childDebug('foo');

//output to console:
//[fooDebugger.child] foo

Keywords

debugging

FAQs

Package last updated on 15 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts