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 🙏

© 2025 – Pkg Stats / Ryan Hefner

uploadzx

v0.1.4

Published

Browser-only TypeScript upload library with tus integration for resumable uploads

Readme

uploadzx

⚠️ Development Notice: This library is currently in active development. The stable release is planned for July 14, 2025. Use with caution in production environments.

npm version npm downloads TypeScript License: MIT

A browser-only TypeScript upload library that provides a developer-friendly abstraction over tus-js-client for resumable file uploads with React integration.

Features

  • 🚀 Resumable uploads using tus protocol
  • 📱 Cross-browser compatibility including Safari fallback
  • File System Access API support for modern browsers
  • 🎯 React integration with hooks and components
  • 📊 Progress tracking with detailed upload statistics
  • ⏸️ Pause, resume, and cancel functionality
  • 💾 Persistent upload state using IndexedDB
  • 🔄 Queue management for multiple uploads
  • 🎨 UI-agnostic design - bring your own UI or use our React components

Installation

npm install uploadzx
# or
pnpm add uploadzx
# or
yarn add uploadzx

Quick Start

Vanilla JavaScript/TypeScript

import Uploadzx from 'uploadzx';

const uploader = new Uploadzx({
  endpoint: 'https://your-tus-endpoint.com/files',
  maxConcurrent: 3,
  filePickerOptions: {
    multiple: true,
    useFileSystemAccess: true,
  }
}, {
  onProgress: (progress) => {
    console.log(`${progress.fileId}: ${progress.percentage}%`);
  },
  onComplete: (fileId, tusUrl) => {
    console.log(`Upload completed: ${tusUrl}`);
  },
  onError: (fileId, error) => {
    console.error(`Upload error for ${fileId}:`, error);
  }
});

// Pick files and start uploading
await uploader.pickAndUploadFiles();

React Integration

import { UploadzxProvider, useUploadzxContext } from 'uploadzx/react';

function App() {
  return (
    <UploadzxProvider
      options={{
        endpoint: 'https://your-upload-server.com/upload',
        chunkSize: 1024 * 1024,
        autoStart: true,
      }}
    >
      <UploadComponent />
    </UploadzxProvider>
  );
}

function UploadComponent() {
  const { pickAndUploadFiles, uploadStates } = useUploadzxContext();
  
  return (
    <div>
      <button onClick={pickAndUploadFiles}>Upload Files</button>
      {Object.entries(uploadStates).map(([fileId, state]) => (
        <div key={fileId}>
          {state.file.name} - {state.status} - {state.progress?.percentage}%
        </div>
      ))}
    </div>
  );
}

React Hooks

  • useUploadzxContext() - Access upload context and state
  • useUploadItem(fileId, state) - Manage individual upload items
  • useQueueActions() - Queue management actions
  • useFilePicker(options) - File picking functionality

React Components

  • UploadzxProvider - Context provider for upload functionality
  • UploadDropzone - Drag and drop upload component

API Reference

Core Options

interface UploadzxOptions {
  endpoint: string;
  chunkSize?: number;
  maxConcurrent?: number;
  autoStart?: boolean;
  filePickerOptions?: {
    multiple?: boolean;
    useFileSystemAccess?: boolean;
    accept?: string;
  };
}

Event Handlers

interface UploadzxEvents {
  onProgress?: (progress: UploadProgress) => void;
  onComplete?: (fileId: string, tusUrl: string) => void;
  onError?: (fileId: string, error: Error) => void;
  onStateChange?: (fileId: string, state: UploadState) => void;
}

Browser Support

  • Chrome/Edge: Full support with File System Access API
  • Firefox: Full support with fallback file picker
  • Safari: Full support with Safari-specific optimizations
  • Mobile browsers: Supported with appropriate fallbacks

Examples

The project includes comprehensive examples:

# Install all dependencies and build library
pnpm examples:install

# Run React + Vite example
pnpm example:react

# Run Vanilla JS + Vite example
pnpm example:vanilla

Development

# Install dependencies
pnpm install

# Build the library
pnpm build

# Watch for changes
pnpm dev

# Run examples
pnpm example:react

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT © uploadzx