Registry / networking / http-node

http-node

JSON →
library1.2.0jsnpmunverified

A standalone repackaging of Node.js's built-in http module (version v6.3.0) as an npm package. It provides the original Node.js HTTP implementation, not a browser shim, and depends on the net module (e.g., chrome-net for Chrome Apps). Useful for running Node.js HTTP code on non-Node.js JavaScript platforms with TCP socket support. Currently at version 1.2.0, with no recent updates; considered stable but outdated.

npm install http-node
INSTALL
IMPORT
SIG · HTTP-NODE
H
http-node
networkingjavascriptv1.2.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

http
const http = require('http-node');
const http = require('http');
Replace Node.js built-in http module by requiring 'http-node' and aliasing builtins in browserify.
default
import http from 'http-node';
import http from 'http';
ESM import works if package supports (check module field). Default export mirrors Node.js http module.
createServer
const server = require('http-node').createServer();
const { createServer } = require('http');
Use http-node to access createServer or other exports.

Demonstrates requiring http-node and creating a basic HTTP server with a custom net module.

const http = require('http-node'); const net = require('net'); // must provide a net module (e.g., chrome-net) // Example: create a simple server (requires net with TCP support) const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello World\n'); }); server.listen(8080, () => { console.log('Server listening on port 8080'); });
Debug
Known issues
gotchaRequires a net module (e.g., chrome-net) that provides TCP sockets; does not work in browser or plain Node.js without custom net.
fix
Provide a compatible net module, like chrome-net for Chrome Apps, or use browserify aliases.
affects: >=1.0.0
gotchaUses http-parser-js (CJS) which may cause compatibility issues in ESM environments.
fix
Ensure http-parser-js is available or pin to a version that supports your runtime.
affects: >=1.0.0
deprecatedBased on Node.js v6.3.0; missing features and fixes from newer Node.js versions (e.g., http2, improved performance).
fix
Consider using a more up-to-date standalone HTTP implementation or native Node.js.
affects: >=1.0.0
gotchaThe built-in Node.js http module cannot be overridden globally; must be used via browserify custom builtins.
fix
Use browserify JS API to alias 'http' to 'http-node' as shown in README.
affects: >=1.0.0
gotchaComments in code mention DTRACE_HTTP_*, LTTNG_HTTP_*, COUNTER_HTTP_* which are stubbed out; no tracing support.
fix
Tracing functions will silently do nothing; this may hide issues.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'net'
http-node requires a net module that is not present in the environment (e.g., browser or custom runtime).
fix
Install and alias a net implementation (e.g., chrome-net) and provide it via browserify: require('chrome-net') and alias 'net' in browserify config.
TypeError: http.createServer is not a function
Incorrect import or module not properly aliased; the default export may not include createServer if not using the correct require path.
fix
Use `const http = require('http-node');` (not `require('http')`) and ensure browserify builtins alias is set correctly.
SyntaxError: Unexpected token import
Package is CommonJS-only; using ESM import without a bundler or Node.js experimental modules may fail.
fix
Use `require('http-node')` instead of `import` or add a bundler like browserify with proper configuration.
Error: Module not found: 'http' in ./node_modules/http-node/lib/request.js
http-node internally requires other http-node modules but the builtins alias isn't applied recursively or the require paths are wrong.
fix
Ensure http-node is fully aliased and all dependencies (http-parser-js, net) are correctly resolved. Use require.resolve('http-node') for the path.
Upgrade
Version history
1.2.0latest on npm
Audit
Dependencies
netrequiredRequired for TCP sockets; must be provided by the environment (e.g., chrome-net)
http-parser-jsrequiredReplaces native http_parser for cross-platform parsing
utilrequiredUsed for deprecation warnings as a replacement for internal/util
Agent activity
13 hits · last 30 days
node
12
Resources
http-node — npm install http-node · libregistry