The `http-https` package, at its sole stable version `1.0.0`, is a minimal wrapper designed to simplify making HTTP or HTTPS requests in Node.js. It automatically selects the appropriate native module (`http` or `https`) based on the protocol found in the target URL, exposing a unified `request` method similar to `http.request`. This package was published over a decade ago (around 2012) by Isaac Schlueter and has seen no updates, new features, or bug fixes since its initial release. Consequently, it is an abandoned project and is not actively maintained. While it streamlined basic outbound web requests in older Node.js environments, modern applications should consider actively maintained alternatives that offer current best practices, better error handling, and broader feature sets.
npm install http-httpsVerified import paths — ran on the pinned version, not inferred.
Demonstrates making both HTTP and HTTPS requests using the `http-https` wrapper, showing how it automatically handles protocol selection, and illustrating its compatibility with both URL strings and parsed URL objects (using Node's built-in `url` module).
Migrate to actively maintained alternatives like `node-fetch`, `axios`, or Node.js's native `undici` module, which offer modern features, better performance, and ongoing security support.
When constructing options objects, use the modern `new URL()` constructor to parse URLs and then extract properties (e.g., `urlObject.hostname`, `urlObject.port`, `urlObject.pathname`) to build the options for `http-https.request`.
Ensure your project is configured for CommonJS or use dynamic `import()` if you must use it in an ESM context (e.g., `const hh = await import('http-https');`). However, migrating to a modern, ESM-compatible library is the recommended approach.Ensure the package is correctly `require`d: `const hh = require('http-https');`. If in an ESM context, consider this package incompatible and use a modern alternative.Ensure `req.end()` is called exactly once after all data has been written to the request body, and avoid attempting to write to the request after `req.end()` has been invoked.
No dependency data recorded yet.