New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

http-node

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-node

Nodes http as a standalone package

Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
216
11.92%
Maintainers
1
Weekly downloads
 
Created
Source

http-node

This module is a standalone package of Nodes http, Node.js v0.12.3. Unlike http-browserify, this is not a shim but the original code of Node, so it requires the net module. This is useful for having the Node core APIs on JS platforms other than Node, where TCP socket APIs are available (which can be wrapped in a net module), such as Chrome Apps.

install / usage with browserify

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:

var browserify = require('browserify');

var builtins = require('browserify/lib/builtins.js');
builtins.http = require.resolve('http-node');

var b = browserify();

b.add(...

The above example will use http-node for all browserify builds. If you only want it for a specific build of a larger build script:

var browserify = require('browserify');

var builtins = require('browserify/lib/builtins.js');
var myBuiltins = {};
Object.keys(builtins).forEach(function(key) {
  myBuiltins[key] = builtins[key];
});

myBuiltins.http = require.resolve('http-node')

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

b.add(...

differences to original Node.js code

  • require calls of _http_* modules prefixed with ./
  • uses http-parser-js
  • commented out calls to DTRACE_HTTP_* and COUNTER_HTTP_*
  • in older versions of stream module, cork was not available, fix for that in _http_outgoing.js

credit

The code is taken from the Node.js project: Copyright Joyent, Inc. and other Node contributors.

Node.js is a registered trademark of Joyent, Inc. in the United states and other countries. This package is not formally related to or endorsed by the official Joyent Node.js project.

license

MIT

FAQs

Package last updated on 15 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts