# @webtorrent/http-node

> Node.js http as a standalone package

Latest version **1.3.0** (published 2022-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @webtorrent/http-node
pnpm add @webtorrent/http-node
yarn add @webtorrent/http-node
bun add @webtorrent/http-node
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2022-01-14 |
| First published | 2022-01-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 84.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Jan Schär |
| Maintainers | feross, mafintosh, flet, watson, diegorbaquero, hicom150, jhiesey, webtorrent-bot |

## Links

- npm: https://www.npmjs.com/package/@webtorrent/http-node
- Repository: https://github.com/webtorrent/http-node
- Homepage: https://github.com/webtorrent/http-node#readme
- Issues: https://github.com/webtorrent/http-node/issues
- npm.io page: https://npm.io/package/@webtorrent/http-node

## Dependencies (2)

- [freelist](https://npm.io/package/freelist.md) ^1.0.3
- [http-parser-js](https://npm.io/package/http-parser-js.md) ^0.4.3

## Recent versions

- 1.3.0 (latest) — 2022-01-14

## README

# http-node
This module is a standalone package of [http](https://nodejs.org/api/http.html) from Node.js v6.3.0.
Unlike [http-browserify](https://github.com/substack/http-browserify), this is not a shim but the original code of Node.js, so it requires the `net` module.
This is useful for having the Node.js core APIs on JavaScript platforms other than Node.js, where TCP sockets are available (which can be wrapped in a `net` module).
One example of this is [Chrome Apps](https://developer.chrome.com/apps/sockets_tcp) with [chrome-net](https://github.com/feross/chrome-net).

## install / usage with browserify

```bash
npm install http-node
```

To use it with browserify, you have to use the JS API of browserify;
the command line API does not support changing builtins.

Example:

```js
const browserify = require('browserify');

const builtins = require('browserify/lib/builtins.js');
var customBuiltins = Object.assign({}, builtins);
customBuiltins.http = require.resolve('http-node');

var b = browserify({builtins: customBuiltins});

b.add(...
```

## differences to original Node.js code

- `require` calls of `_http_*` modules prefixed with `./`
- `require('internal/util').deprecate` replaced by `require('util').deprecate`
- uses [http-parser-js](https://github.com/creationix/http-parser-js)
- commented out calls to `DTRACE_HTTP_*`, `LTTNG_HTTP_*` and `COUNTER_HTTP_*`
- does not presume that sockets have a `_handle`

## credit

The code is taken from the [Node.js](https://nodejs.org) project:

Copyright Node.js contributors. All rights reserved.

## license

MIT

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