Socket
Socket
Sign inDemoInstall

debug

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debug - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

5

History.md
0.1.0 / 2011-12-02
==================
* Added: remove colors unless stderr isatty [TooTallNate]
0.0.1 / 2010-01-03

@@ -3,0 +8,0 @@ ==================

26

lib/debug.js

@@ -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;
}

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc