iso-stream-http is a JavaScript module that provides an isomorphic (browser and Node.js compatible) implementation of Node.js's native `http` module. Currently at version 0.1.2, it aims to replicate the Node.js HTTP client API as closely as possible within browser environments, offering pseudo-streaming capabilities where the entire response is held in memory, and in some modern browsers, true streaming. It is heavily inspired by and intended to replace `stream-http`. The project appears to have a slow release cadence, with the latest update being minor bug fixes. Key differentiators include its isomorphic nature, aiming for Node.js API parity in the browser, and its focus on providing data before the request completes, which is a significant feature for handling larger responses efficiently in both client and server contexts.
npm install iso-stream-httpVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to make an HTTP GET request, handle streaming data chunks, and detect the end of the response using `iso-stream-http`'s Node.js-like API.
Avoid relying on `http.Agent` for browser-based requests. For advanced network control in the browser, consider `fetch` API options or browser-specific network configurations, which are outside the scope of this library.
Do not attempt to use socket-specific events or methods. For request timeouts, use `options.requestTimeout` which is a library-specific alternative, but note it behaves differently than Node's `setTimeout`.
Be aware of browser-enforced header limitations. For debugging, inspect `message.headers` (which is processed by the browser) rather than expecting raw headers. Do not rely on `trailers` for critical response data.
Assume redirects are handled transparently. If redirect URLs or statuses are required, a server-side proxy or a different browser-native API (like `fetch` with `redirect: 'manual'`) would be necessary.
Update `iso-stream-http` to version 0.1.2 or later, as this specific error was addressed in that release.
Remove any code attempting to interact with the underlying socket or listen for socket-specific events. The library does not expose this level of control. Focus on `data`, `end`, and `error` events for the response stream.
No dependency data recorded yet.