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

@blossm/request

v0.0.70

Published

Http access.

Readme

HTTP access through Node's native fetch, with the existing post, put, del, get, stream and streamMany interface. No Request or merge-stream dependency.

JSON writes accept body; their response bodies are parsed when valid JSON. GET/DELETE and multipart responses retain text bodies. Every ordinary response has headers, statusCode, statusMessage and body, including HTTP errors. Repeated Set-Cookie headers remain an array. Native fetch decodes supported compression, so metadata removes the stale Content-Encoding/Content-Length for those decoded representations. formData accepts scalar fields, Buffers, Blobs and {value, options} fields with filename and contentType. Unopened path-backed file streams use native file-backed Blobs; already-open, descriptor-backed and other multipart streams are buffered with cancellation. Multipart buffering has no byte limit. For large files, pass a file-backed Blob from node:fs's openAsBlob to avoid buffering. File-stream byte ranges and existing descriptors are respected. Passing formData hands its Node input streams to the adapter: they are consumed during preparation or destroyed on failure/cancellation, including a signal that was already aborted. Successfully consumed streams with autoClose:false retain caller ownership of their descriptor. Use one of body and formData.

All methods accept signal and timeout in milliseconds, default 30 seconds per multipart-preparation phase, upload/response-header wait, and response-chunk wait. Upload progress does not reset the upload/headers deadline. Streams await each callback before reading again, reject HTTP errors before callbacks, abort on callback failure/cancellation and optionally call onResponseFn({headers,statusCode,statusMessage}) before data. A slow callback does not consume the network idle timeout. Callers own retries; mutating requests are never retried automatically.

GET redirects follow at most five hops. Authorization, Cookie and Proxy-Authorization are stripped when origin changes; HTTPS downgrade redirects are rejected. Writes return redirect responses without following them.

streamMany(requests, fn, sortFn, options) merges sorted input streams using one lookahead value per source and one awaited output callback. Inputs must already be sorted according to sortFn; it cannot sort arbitrary whole streams. An empty request list completes without callbacks. Failure cancels all sources. The optional decode factory returns a per-source {write,end} decoder so framed records can be decoded before comparing/merging, without sharing parser state between sources. Without a decoder, values remain raw byte chunks.

jsonDecoder() creates independent UTF-8 framing state for consecutive JSON objects/arrays. Feed chunks with write(chunk) and flush with end(). Quoted braces, nesting, escapes and byte-split code points are retained. Invalid UTF-8 bytes, malformed JSON, non-JSON separators and truncated final records reject the stream. Direct string chunks retain their UTF-16 characters across splits. The decoder buffers an incomplete record without a byte cap. Raw HTTP streams are not implicitly parsed; generic RPC explicitly opts in, with independent state for every HTTP execution, including retries and concurrent executions.