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

@lp-labs/react-upload

v0.1.0

Published

Validated file selection and bounded uploads with progress and cancellation.

Readme

@lp-labs/react-upload

Validated file selection, file drops and bounded concurrent uploads with progress/cancellation. React 18+ peer only; native XMLHttpRequest and FormData transport. ESM, CommonJS and TypeScript included.

Installation

npm install @lp-labs/react-upload

Quick Start

import { Upload } from '@lp-labs/react-upload';
export default function Example() {
  return <Upload url="/api/files" accept=".pdf,image/*" maxFiles={5} maxFileSize={10485760} />;
}

The endpoint must accept POST multipart data under field file and respond with a2xx status. Uploading is an explicit user action, not automatic after selection.

API

Upload supplies file input, drop handling, Upload/Cancel controls, status and progress. children(api) replaces its default status/actions. useUpload(options) returns entries, error, isUploading, addFiles(FileList|File[]), start():Promise, cancel(id?), remove(id), retry(id). Retry is intended for error/canceled entries. Entries expose id,file,status,progress,error. A start processes the currently queued snapshot; newly added files need another start.

Options: url, accept, maxFiles: 10, maxFileSize: 10 MiB, maxTotalSize: 50 MiB, and concurrency: 2, headers, withCredentials=false, allowCrossOrigin=false, onComplete(file), or custom upload(file,{signal,onProgress}). Custom transport owns response parsing and must honor AbortSignal. Native uploadFile additionally supports fieldName and timeout (default: 120 s; range: 1 s–1 h). validateFiles and validateUploadUrl are exported. Unmount aborts active uploads and suppresses late updates.

Benefits

| Area | Details | | ---------------------- | ---------------------------------------------------------------- | | Explicit resource caps | Bound file count, individual size, total bytes, and concurrency. | | Cancelable transport | Track progress and cancel active requests. | | Extension point | Use custom upload transport or the built-in multipart request. |

Customization

| Area | Details | | ----------- | -------------------------------------------------------------------- | | Validation | Set accepted types, count, per-file size, and aggregate size. | | Transport | Configure URL, safe headers, credentials, timeout, or custom upload. | | Concurrency | Limit simultaneous uploads from one to eight. |

Security And Limits

Hard caps: 1,000 files, 1 GiB per file, 2 GiB total, and 8 workers; native transport timeout is bounded. File names reject slashes/control characters. Accept/MIME/extension checks are usability checks, not malware detection: servers must independently enforce size, MIME sniffing, authentication, authorization, safe names, storage isolation, antivirus policy and CSRF controls. Browser-provided metadata can be forged. Same-origin HTTP(S) URLs are default; cross-origin requires explicit opt-in and CORS. HTTPS pages reject insecure remote HTTP upload targets. URL credentials, non-HTTP schemes, newline headers and manually supplied multipart Content-Type are rejected. Never hard-code credentials in component props or repositories. Cancellation cannot guarantee a server stopped processing a request. No resumable/chunked upload, hashing, cloud-signing or response-body parsing is included.

Support

Donate via PayPal. Author: Libin Prasanth.

License

MIT License. See the packaged LICENSE file.