http-debug is a lightweight utility designed to provide verbose debugging output for Node.js `http` and `https` requests. It operates by patching Node's built-in `http` and `https` modules to intercept and log request, write, end, and socket events to `stderr`. The current stable version is `0.1.2`. Given its low version number and the age of the provided changelog, the project appears to have a very slow or effectively ceased release cadence, last updated around 2013-2014. Its primary differentiator is its simplicity and direct global patching approach, allowing for debugging without modifying application code for each request, though this can lead to conflicts. It supports enabling debugging via `process.env.HTTP_DEBUG` or by setting `http.debug` at runtime, offering different verbosity levels.
npm install http-debugVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and enable verbose HTTP request debugging using http-debug, then makes a sample HTTP GET request to observe the detailed output on stderr.
Avoid using `http-debug` in environments where other global `http`/`https` interceptors are present. Consider alternative debugging methods like network proxies or `console.log` on `request.on('request')` events for complex scenarios. Given its age, it might also conflict with modern Node.js versions or features.Be mindful of the precedence. If you want to control debugging solely via environment variables, ensure `http.debug` (or `https.debug`) is not explicitly set in your code after the module is loaded.
For new projects or existing projects needing active support, consider using modern debugging tools like Node.js's built-in debugger, `process.env.NODE_DEBUG`, dedicated network proxies (e.g., Fiddler, Charles, mitmproxy), or more actively maintained HTTP client debugging utilities.
Ensure your project uses CommonJS (`.js` files with `require`) or a build setup that correctly transpiles `require` calls if you're using ES Modules.
Ensure `const http = require('http-debug').http;` is called before accessing `http.debug`. Verify `http-debug` is installed and accessible.Use `const http = require('http-debug').http;` to correctly import the patched `http` module.Run `npm install http-debug` to install the package.
No dependency data recorded yet.