Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Jun 6, 2024 via pnpm

debug 4.3.4

Lightweight debugging utility for Node.js and the browser
Package summary
Share
0
issues
1
license
2
MIT
Package created
29 Nov 2011
Version published
17 Mar 2022
Maintainers
4
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
debug@4.3.4
ms@2.1.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of debug 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
ms2.1.22.95 kBMIT
prod

Visualizations

Frequently Asked Questions

What does debug do?

Debug is a lightweight JavaScript utility based on Node.js core's debugging technique. It is designed for both Node.js and web browsers. This versatile tool is ideal for developers seeking to add debug statements to their module and toggle the output of these statements as needed. This feature can greatly aid in identifying and rectifying errors within a module or its various parts.

How do you use debug?

To start using debug, you need to first install it into your project. This can be done using NPM (Node Package Manager) with the command npm install debug. Once installed, debug can be imported into your JavaScript file with var debug = require('debug')('http'), where 'http' is the name of your module. Debug then returns a decorated version of console.error for you to pass debug statements to. Here is an example of how you can use debug in a node.js application:

var debug = require('debug')('http')
, http = require('http')
, name = 'My App';

// fake app

debug('booting %o', name);

http.createServer(function(req, res){
  debug(req.method + ' ' + req.url);
  res.end('hello\n');
}).listen(3000, function(){
  debug('listening');
});

// fake worker of some kind

require('./worker');

In this example, debug('booting %o', name) is equivalent to a console.log()-like statement which will only be displayed when the debug is enabled.

Where are the debug docs?

The documentation for debug can be found within their Github repository at git://github.com/debug-js/debug.git. The readme file within the repository is richly detailed and provides comprehensive guidance on how to install, configure and use the debug utility effectively. It encompasses everything from basic usage to more advanced features like namespace colors, wildcard usage, custom formatters, and environment variables. Developers seeking to make the most of this debug utility would greatly benefit from a thorough perusal of the readme.