Comparing version 0.0.1 to 0.1.0
0.1.0 / 2011-12-02 | ||
================== | ||
* Added: remove colors unless stderr isatty [TooTallNate] | ||
0.0.1 / 2010-01-03 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -9,2 +9,8 @@ | ||
/** | ||
* Module dependencies. | ||
*/ | ||
var tty = require('tty'); | ||
/** | ||
* Expose `debug()` as the module. | ||
@@ -19,3 +25,3 @@ */ | ||
exports.version = '0.0.1'; | ||
exports.version = '0.1.0'; | ||
@@ -41,2 +47,8 @@ /** | ||
/** | ||
* Is stderr a TTY? Colored output is disabled when `true`. | ||
*/ | ||
var isatty = tty.isatty(process.stderr.fd || 2); | ||
/** | ||
* Select a color. | ||
@@ -63,6 +75,14 @@ * | ||
var c = color(); | ||
return function(fmt){ | ||
function colored(fmt) { | ||
fmt = ' \033[3' + c + 'm' + name + '\033[90m ' + fmt + '\033[0m'; | ||
console.error.apply(this, arguments); | ||
} | ||
} | ||
function plain(fmt) { | ||
fmt = ' ' + name + ' ' + fmt; | ||
console.error.apply(this, arguments); | ||
} | ||
return isatty ? colored : plain; | ||
} |
{ | ||
"name": "debug" | ||
, "version": "0.0.1" | ||
, "version": "0.1.0" | ||
, "description": "small debugging utility" | ||
@@ -5,0 +5,0 @@ , "keywords": ["debug", "log", "debugger"] |
@@ -6,2 +6,8 @@ | ||
## Installation | ||
``` | ||
$ npm install debug | ||
``` | ||
## Example | ||
@@ -61,2 +67,10 @@ | ||
![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) | ||
![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) | ||
## Conventions | ||
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. | ||
## License | ||
@@ -63,0 +77,0 @@ |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
5309
77
97
2