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-httpVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing the client, making a GET request, a POST request with data, and handling responses and specific HTTP status events using callbacks.
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.
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.
Do not use this package in any environment where security is a concern. Migrate to a well-audited and actively maintained HTTP client library.
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.
Always instantiate using `new NodeHttp()` after `const NodeHttp = require('node-http');`.Ensure you are using `new NodeHttp()` to create an instance.
Change `new Http()` to `new NodeHttp()` after `const NodeHttp = require('node-http');`.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.
No dependency data recorded yet.