# http-debug

> Simple http(s) request debugger.

Latest version **0.1.2** (published 2014-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install http-debug
pnpm add http-debug
yarn add http-debug
bun add http-debug
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2014-02-23 |
| First published | 2014-02-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Joshua P Mervine |
| Maintainers | jmervine |
| Keywords | debug, debugging, debugger, http, https, request |

## Links

- npm: https://www.npmjs.com/package/http-debug
- Repository: https://github.com/jmervine/node-http-debug
- Issues: https://github.com/jmervine/node-http-debug/issues
- npm.io page: https://npm.io/package/http-debug

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2014-02-23
- 0.1.1 — 2014-02-16
- 0.1.0 — 2014-02-15
- 0.0.1 — 2014-02-15

## README

# http-debug

[![Build Status](https://travis-ci.org/jmervine/node-http-debug.png?branch=master)](https://travis-ci.org/jmervine/node-http-debug) &nbsp; [![Dependancy Status](https://david-dm.org/jmervine/node-http-debug.png)](https://david-dm.org/jmervine/node-http-debug) &nbsp; [![NPM Version](https://badge.fury.io/js/http-debug.png)](https://badge.fury.io/js/http-debug)


``` sh
npm install http-debug
```

Usage:

``` javascript
var http = require('http-debug').http;
// var https = require('http-debug').https;

http.debug = 2;

/****
 * debug states
 * - 0     : off     (default state)
 * - 1     : on      (show request, write, end)
 * - 2     : verbose (on + error and socket event reporting)
 *
 * Also support `process.env.HTTP_DEBUG` at load time, which
 * will overide default state, however, anything passed via
 * `http.debug` at run time will cancel out
 * `process.env.HTTP_DEBUG`.
 ****/

// Make http requests as usual.
http.get('http://mervine.net/', function (err, res) {
   if (err) console.trace(err);
   console.log(res.statusCode);
});

```

Sample Output:
``` sh
# on stderr

HTTP REQUEST:
{ ... http request data ... }
HTTP REQUEST: END CALLED
{ ... request end data if any ... }
HTTP REQUEST: SOCKET EVENT
{ ... request socket event data ... }

```

# Development

Please contribute. I built this quickly for my own needs.

``` sh
git clone https://github.com/jmervine/node-http-debug.git
cd node-http-debug
npm install
npm test
```

No pull requests will be accepted unless tests are (added if need be and) passing.

# Change Log

### 0.1.1

* Support for `process.env.HTTP_DEBUG`.
* `https` test.

### 0.1.0

* Initial release.

---
_Source: https://npm.io/package/http-debug · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
