Registry / http-networking / node-http

node-http

JSON →
library0.0.5jsnpmunverified

This package, `node-http`, provides a minimalistic interface for making HTTP requests within Node.js applications. Originally published over 12 years ago (latest version 0.0.5 from October 2013), it aims to unify the HTTP request process with a chainable API for setting URL, headers, data, and method, alongside event-based callbacks for completion, success, and failure. Due to its age and lack of updates, it is considered abandoned. It exclusively uses CommonJS syntax and does not support modern JavaScript features like Promises or async/await, nor does it officially support contemporary Node.js versions or ESM. Its release cadence was effectively one-off, with no subsequent development. Key differentiators at the time might have been its simplified event-driven approach, but it is now severely outdated compared to actively maintained alternatives like `axios` or Node.js's native `fetch` API.

npm install node-http
INSTALL
IMPORT
SIG · NODE-HTTP
N
node-http
http-networkingjavascriptv0.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

NodeHttp
const NodeHttp = require('node-http');
import { NodeHttp } from 'node-http';
This package is CommonJS-only and does not support ES Modules. Attempting to use `import` syntax will result in an error.
Http instance
const NodeHttp = require('node-http'); const nodeHttp = new NodeHttp();
import NodeHttp from 'node-http'; const nodeHttp = new NodeHttp();
The primary interaction is creating an instance of the exported constructor function. The module exports the constructor directly, not a default export.

Demonstrates initializing the client, making a GET request, a POST request with data, and handling responses and specific HTTP status events using callbacks.

const NodeHttp = require('node-http'); const nodeHttp = new NodeHttp(); // Example: Perform a GET request nodeHttp.GET('http://example.com/data', function (response) { console.log('Success:', response.responseText); console.log('Status Code:', response.statusCode); }).fail(function (error) { console.error('Failed to fetch data:', error); }); // Example: Perform a POST request with data nodeHttp.POST('http://example.com/submit', { key: 'value', id: 123 }, function (response) { console.log('Post Success:', response.responseText); }).on('error', function(err) { console.error('Post Error:', err); }); // Example: Listening for specific status codes nodeHttp.on(200, function(response) { console.log('HTTP 200 OK received for a request.'); }); nodeHttp.on('Not Found', function(response) { console.error('HTTP 404 Not Found received.'); });
Debug
Known issues
breakingThis package (v0.0.5) was last published over 12 years ago. It is completely unmaintained and relies on deprecated patterns and old Node.js APIs, making it highly incompatible with modern Node.js versions (v14+).
fix
Migrate to a modern, actively maintained HTTP client library like `axios`, `node-fetch`, or Node.js's built-in `http`/`https` modules, or the native `fetch` API in newer Node.js versions.
affects: >=0.0.5
breakingThe package uses CommonJS `require()` syntax exclusively and does not provide ES Module exports. This will cause issues in modern Node.js projects configured for ESM or in TypeScript projects targeting ESM.
fix
If migration is not an immediate option, configure your project to allow CommonJS imports (e.g., using `require()` in an ESM context via `createRequire` or using build tools that transpile). However, full migration is strongly recommended.
affects: >=0.0.5
gotchaDue to its age, this package likely lacks essential security patches for HTTP vulnerabilities (e.g., related to headers, redirects, certificate validation, or data parsing). Using it in production is a significant security risk.
fix
Do not use this package in any environment where security is a concern. Migrate to a well-audited and actively maintained HTTP client library.
affects: >=0.0.5
gotchaThe callback-based API does not support Promises or `async/await`, leading to callback hell and making integration with modern asynchronous JavaScript patterns difficult.
fix
Rewrite HTTP request logic using modern Promise-based APIs or `async/await` with contemporary libraries. If stuck with this package, wrap its calls in custom Promises.
affects: >=0.0.5
gotchaThe `NodeHttp` constructor is exposed directly. While the README shows `var nodeHttp = new Http;`, the actual imported name is `NodeHttp`. Using `new Http` after `require('node-http')` would result in a `ReferenceError` unless `Http` was separately defined.
fix
Always instantiate using `new NodeHttp()` after `const NodeHttp = require('node-http');`.
affects: >=0.0.5
Errors
Common errors & fixes
TypeError: NodeHttp is not a constructor
Attempting to call `NodeHttp` without `new` or treating it as a non-constructor function.
fix
Ensure you are using `new NodeHttp()` to create an instance.
ReferenceError: Http is not defined
The README uses `new Http()` but the module exports `NodeHttp`. Developers often copy the README literally.
fix
Change `new Http()` to `new NodeHttp()` after `const NodeHttp = require('node-http');`.
ERR_REQUIRE_ESM
Attempting to `require()` this CommonJS package from an ES Module context in Node.js.
fix
Refactor your project to use modern ESM-compatible HTTP clients, or if absolutely necessary, use `createRequire` to explicitly load the CommonJS module from an ESM file.
Upgrade
Version history
0.0.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources