npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zucker-framework/fe-http-client

v1.0.16

Published

`HttpClient` provides configured JSON requests, authentication refresh, downloads, uploads and consumer error callbacks. Normalized HTTP failures retain `response`, `request`, `config`, transport `code` and `cause`, including binary error bodies. A login-

Readme

Frontend HTTP client

HttpClient provides configured JSON requests, authentication refresh, downloads, uploads and consumer error callbacks. Normalized HTTP failures retain response, request, config, transport code and cause, including binary error bodies. A login-page 401 clears stale authentication without redirecting. fetchStream preserves caller cancellation (no error toast or authentication clearing), and refreshed requests retain the caller signal. createCookieRefresh implements a credentials-bearing refresh exchange, while BaseService provides reusable CRUD requests. SSE primitives are connectSse, parseSseEventBlock and readSseStream.

proxyHttpRequest(request, targetUrl, options) forwards a standard Web Request and returns a streaming Response. The consumer must choose a trusted upstream URL and owns application routing, environment lookup and failure responses. No Next.js or backend-framework dependency is introduced.

The proxy removes the inbound Host header, forwards authentication headers and the request signal, preserves response status/headers/body, removes transfer encoding and sets X-Accel-Buffering: no. Mutation bodies are read once. Optional retryDelaysMs apply only to GET/HEAD transport failures, never to mutation requests or HTTP error statuses; abortion cancels a retry wait. Responses, including SSE, are not buffered. fetcher supports isolated tests and explicit transports.

Public proxy contract tests are in src/proxy.spec.ts. Existing HTTP/SSE tests remain relevant. New exports require validation and an immutable package release before published-package consumers use them.

extractErrorMessage(error, { fallback, separator? }) prefers a nonempty server response message over a direct error message, accepts string-array messages and keeps consumer fallback text outside the library. The default array separator is ; ; applications can preserve an existing localized separator explicitly.

Binary HTTP failures decode JSON Blob/ArrayBuffer bodies up to 1 MiB for message/code/details, without replacing response.data. Malformed, oversized and non-object JSON bodies retain transport evidence and fall back to the status message. This is error decoding, not validation of downloaded files.

RequestConfig._rawResponse: true returns the full Axios response before envelope unwrapping, including arbitrary third-party JSON fields. It still processes token headers and HTTP errors. Default envelope behavior is unchanged; external API consumers must configure their own credential and redirect policy rather than reuse a product-authenticated client.

A cancelled fetchStream waiter rejects immediately while other callers can finish the shared refresh. Refreshed stream responses undergo the same permission/status checks, and retry transport failures do not revoke valid identity. readSseStream cancels the upstream reader on parser/consumer failure, preserves the original error if cancellation fails, and releases the lock. Source tests are not evidence that an older published version includes these lifecycle fixes.