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

@stll/fetch

v0.1.1

Published

Fetch with a mandatory timeout (headers or idle body window), connection-failure classification, and a robots-aware polite publisher fetch

Readme

@stll/fetch

fetch with a timeout you cannot forget, plus transport-failure helpers.

fetchWithTimeout

import { fetchWithTimeout } from "@stll/fetch";

// Abort when no response headers arrive within 5 seconds.
const response = await fetchWithTimeout(url, {
  timeout: { type: "headers", ms: 5_000 },
});

// Abort when the headers, or any later body chunk, take longer than
// 10 seconds: a slow but progressing download keeps going.
const stream = await fetchWithTimeout(url, {
  timeout: { type: "idle", ms: 10_000 },
  signal: controller.signal, // optional; either signal aborts the request
});

The timeout is required by the type. headers bounds the wait for the response; idle also restarts on every body chunk and errors the body stream when it stalls; total bounds the request and its body consumption through the transport's own signal and returns the transport's response unchanged. A timeout rejects (or errors the body) with a TimeoutError DOMException, and the caller's signal and a Request's own signal still abort the request. timeoutMs: number remains the legacy numeric form of the total policy.

createFetchWithTimeout(fetcher) returns the same function over another fetch implementation (a proxy-aware client, or a fake in tests).

isConnectionFailure(error) reports whether an error, or any error in its cause chain, is a connection-level failure (refused, reset, DNS, TLS certificate, socket and connect timeouts) across Bun, Node and undici.

@stll/fetch/publisher

This entry needs Bun: it waits between requests with Bun.sleep.

createPolitePublisherFetch({ validateTarget, fetcher }) fetches from public websites politely: it reads and caches each origin's robots.txt, honours Disallow and Crawl-delay rules, spaces requests per origin, follows at most five redirects (validating each hop with validateTarget), and returns refusals as typed better-result errors. Requests identify as Stella/1.0 (+https://stll.app), the product token its robots evaluation uses. readBoundedBody(response, { maxBytes, signal }) reads a body with a size cap.