Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "depugger", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "small debugging utility", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,5 +9,31 @@ # node-depugger | ||
Depugger is a small lib that provides a debugging utility. | ||
## 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 | ||
````javascript | ||
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: | ||
````javascript | ||
var depugger = require('depugger'); | ||
var debug = depugger({debug: true, name: 'fooDebugger'}); | ||
@@ -14,0 +40,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8078
50