Registry / http-networking / hyperquest

hyperquest

JSON →
library0.1.13jsnpmunverified

Hyperquest is a lightweight, streaming HTTP client for Node.js, last updated to version 2.1.3 approximately eight years ago. It was created by Substack to address fundamental shortcomings in Node.js's native `http` module prior to version 0.12, specifically concerning default idle timeouts (2 minutes) and a restrictive connection pool limit (5 requests). These defaults often led to applications hanging or experiencing unexpected behavior when making multiple concurrent HTTP requests. Hyperquest bypassed these internal Node.js annoyances by treating HTTP requests purely as streaming transports, removing pooling and extending default timeouts significantly. While it offered a streamlined, 'request'-like API, it was designed for raw streaming without buffering or automatic JSON parsing. Given that its core purpose was to mitigate issues resolved in much older Node.js versions (specifically, Node.js 0.12 and later fixed many of these `http` module defaults), the package is now considered abandoned and not suitable for modern Node.js development.

npm install hyperquest
INSTALL
IMPORT
SIG · HYPERQUEST
H
hyperquest
http-networkingjavascriptv0.1.13
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.

hyperquest
const hyperquest = require('hyperquest');
import hyperquest from 'hyperquest';
This package is CommonJS-only and does not support ESM imports directly. It was last published before widespread ESM adoption in Node.js.

Demonstrates a basic streaming GET request using `hyperquest` to a local HTTP server and piping the response to standard output.

const hyperquest = require('hyperquest'); const http = require('http'); // Create a simple HTTP server to test against const server = http.createServer((req, res) => { console.log(`Server received request for: ${req.url}`); res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello from hyperquest server!'); }); server.listen(8000, () => { console.log('Server listening on http://localhost:8000'); // Make a streaming GET request using hyperquest const reqStream = hyperquest('http://localhost:8000'); reqStream.on('data', (chunk) => { process.stdout.write('Client received: ' + chunk.toString()); }); reqStream.on('end', () => { console.log('\nClient finished receiving data.'); server.close(); // Close the server after the request is done }); reqStream.on('error', (err) => { console.error('Hyperquest error:', err); server.close(); }); });
Debug
Known issues
breakingThe primary issues `hyperquest` was designed to solve (Node.js's default 2-minute idle timeout and 5-connection pooling limit in `http.request`) were largely addressed in Node.js 0.12 and subsequent versions. Using `hyperquest` in modern Node.js (v4.x+) offers little benefit and may introduce compatibility issues or unexpected behavior due to its outdated approach to HTTP streaming.
fix
For modern Node.js, rely on the native `http` module, `undici`, `node-fetch`, or `axios`. Configure `agent` options (like `maxSockets`, `keepAlive`, `timeout`) directly on native HTTP agents as needed. For example, use `new http.Agent({ keepAlive: true, maxSockets: Infinity })`.
affects: >=3.0.0 (of Node.js, not hyperquest)
deprecatedThe `hyperquest` package is effectively abandoned, with its last npm publication over eight years ago (v2.1.3 in January 2018). It is not maintained, does not receive security updates, and is not compatible with modern Node.js module systems (ESM).
fix
Migrate to actively maintained and modern HTTP clients like `undici` (built-in Node.js `fetch`), `node-fetch`, or `axios`. If streaming is critical, explore stream-based solutions within these modern clients or libraries built on top of them.
affects: >=2.1.3
gotcha`hyperquest` is a CommonJS-only package. Attempting to `import hyperquest from 'hyperquest'` in an ESM module context will result in a runtime error.
fix
If used in an ESM project, you must use `require` via `createRequire` from the `module` built-in module: `import { createRequire } from 'module'; const require = createRequire(import.meta.url); const hyperquest = require('hyperquest');`. However, migrating away from `hyperquest` is strongly recommended.
affects: >=2.1.3
gotcha`hyperquest` provides a raw streaming interface, unlike higher-level libraries such as `request` or `axios` which automatically buffer responses or parse JSON. Users must manually handle stream events (`data`, `end`, `error`) and process chunks.
fix
Always attach `data`, `end`, and `error` event handlers to the returned stream. Accumulate data chunks if a complete response body is needed, and parse manually (e.g., `JSON.parse(Buffer.concat(chunks).toString())`) if the content type is JSON.
affects: >=0.1.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module ... from ... not supported.
Attempting to `require()` an ESM module, or (more commonly for this package) attempting to `import` this CJS package into an ESM context.
fix
This error indicates a module system mismatch. Since `hyperquest` is CommonJS, if you are in an ESM file, you must use `import { createRequire } from 'module'; const require = createRequire(import.meta.url); const hyperquest = require('hyperquest');`. However, consider migrating to a modern, actively maintained HTTP client with native ESM support.
TypeError: Cannot read properties of undefined (reading 'pipe')
The `hyperquest` function was called without a valid URL, or the URL was malformed, causing it to return an undefined or invalid stream object.
fix
Ensure that the `hyperquest()` function is called with a well-formed URL string. For example: `hyperquest('http://example.com/api')`.
Upgrade
Version history
0.1.13latest on npm
Audit
Dependencies
buffer-fromrequiredUtility for creating Node.js Buffer instances from various inputs.
duplexer2requiredAllows combining a writable stream and a readable stream into a single duplex stream, central to hyperquest's streaming design.
through2requiredA tiny wrapper around Node.js streams2 Transform to make working with streams easier.
Agent activity
6 hits · last 30 days
node
6
Resources
hyperquest — npm install hyperquest · libregistry