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.1.0 to 0.2.0

example/wildcards.js

5

History.md
0.2.0 / 2012-01-22
==================
* Added wildcard support
0.1.0 / 2011-12-02

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

15

lib/debug.js

@@ -24,3 +24,3 @@

exports.version = '0.1.0';
exports.version = '0.2.0';

@@ -31,3 +31,8 @@ /**

var names = (process.env.DEBUG || '').split(/[\s,]+/);
var names = (process.env.DEBUG || '')
.split(/[\s,]+/)
.map(function(name){
name = name.replace('*', '.*?');
return new RegExp('^' + name + '$');
});

@@ -72,3 +77,7 @@ /**

function debug(name) {
if (!~names.indexOf(name)) return function(){};
var match = names.some(function(re){
return re.test(name);
});
if (!match) return function(){};
var c = color();

@@ -75,0 +84,0 @@

2

package.json
{
"name": "debug"
, "version": "0.1.0"
, "version": "0.2.0"
, "description": "small debugging utility"

@@ -5,0 +5,0 @@ , "keywords": ["debug", "log", "debugger"]

@@ -72,4 +72,8 @@

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.
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. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
## Wildcards
The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`.
## License

@@ -76,0 +80,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