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

use-courier

v0.4.0

Published

A headless React hook for file uploads with progress tracking, retries, cancellation, and chunked uploads for large files.

Readme

use-courier

npm version license

A headless React hook for file uploads with real progress tracking, retries, cancellation, and chunked uploads for large files.

Why useCourier?

fetch can't report upload progress — there's no way to know how many bytes of a file have actually been sent, only when the whole request finishes. useCourier uses XMLHttpRequest under the hood specifically to expose real 0-100% upload progress, wrapped in a small, typed, headless hook you build your own upload UI on top of.

  • Real upload progress — accurate 0-100% progress per file as bytes are actually sent, not a spinner
  • Retries — re-run a failed upload without asking the user to re-select the file
  • Cancellation — abort an in-flight upload, or every upload in flight on unmount
  • Chunked uploads — automatically splits large files into sequential requests, retrying failed chunks independently
  • Lifecycle callbacks — beforeUpload, onUploadSuccess, onUploadError, onUploadFinish, onUploadRetry, onRemoveFile
  • Headless — no UI, no styling opinions; works with any component library
  • Typed — full TypeScript support, generic over your API's response shape

Installation

npm install use-courier

use-courier supports React 18 and React 19.

Basic usage

import type { ChangeEvent } from "react";
import { useCourier } from "use-courier";

export function FileUpload() {
  const { files, addFile } = useCourier({
    url: "/api/uploads",
  });

  function handleFileChange(event: ChangeEvent<HTMLInputElement>) {
    Array.from(event.target.files ?? []).forEach((file) => {
      void addFile(file);
    });
  }

  return (
    <>
      <input type="file" multiple onChange={handleFileChange} />
      {files.map((item) => (
        <p key={item.id}>
          {item.file.name}: {item.status} ({item.uploadProgress}%)
        </p>
      ))}
    </>
  );
}

Documentation

Full API reference, backend integration guides for Express, Next.js, TanStack Start, and Hono, large-file chunking details, and a Shadcn attachments integration:

useCourier Documentation

The docs also publish an llms.txt and llms-full.txt for LLM tooling.

License

MIT © Zach Philipp