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

@oxog/filekit

v1.0.0

Published

Zero-dependency file upload toolkit with drag & drop, chunked transfers, and progress tracking

Readme

FileKit

Zero-dependency file upload toolkit with drag & drop, chunked transfers, progress tracking, and first-class React support.

npm version bundle size license

Features

  • Zero Dependencies - No external runtime dependencies
  • TypeScript First - Written in strict TypeScript with complete type definitions
  • Small Bundle - Core < 4KB, with React < 6KB (minified + gzipped)
  • Drag & Drop - Built-in drop zone with visual feedback
  • Chunked Uploads - Upload large files in chunks with parallel transfers
  • Progress Tracking - Real-time upload progress with speed and ETA
  • Validation - File size, type, and custom validators
  • Image Preview - Generate thumbnails and compress images
  • React Integration - First-class hooks and components

Installation

npm install @oxog/filekit

Quick Start

Vanilla JavaScript

import { createUploader } from '@oxog/filekit'

const uploader = createUploader({
  endpoint: '/api/upload',
  maxFileSize: 10 * 1024 * 1024, // 10MB
  allowedTypes: ['image/*', 'application/pdf'],
})

uploader.on('progress', (file) => {
  console.log(`${file.name}: ${file.progress}%`)
})

uploader.on('complete', (file) => {
  console.log(`Uploaded: ${file.name}`)
})

// Add files and upload
uploader.addFiles(files)
uploader.uploadAll()

React

import { useUploader, DropZone, FileList } from '@oxog/filekit/react'

function FileUpload() {
  const { files, addFiles, uploadAll, progress, isUploading } = useUploader({
    endpoint: '/api/upload',
    maxFileSize: 10 * 1024 * 1024,
  })

  return (
    <div>
      <DropZone onDrop={addFiles}>
        {({ isDragActive }) => (
          <div>{isDragActive ? 'Drop files here...' : 'Drag files here or click to browse'}</div>
        )}
      </DropZone>

      <FileList files={files} showPreview showProgress />

      <button onClick={uploadAll} disabled={isUploading}>
        {isUploading ? `Uploading... ${progress.percentage}%` : 'Upload All'}
      </button>
    </div>
  )
}

Documentation

Visit filekit.oxog.dev for full documentation.

API Overview

Core Functions

import {
  createUploader,
  createDropZone,
  createValidator,
  createUploadQueue,
} from '@oxog/filekit'

Preview Functions

import {
  createImagePreview,
  getImageDimensions,
  compressImage,
} from '@oxog/filekit'

Utility Functions

import {
  isImage,
  isVideo,
  formatFileSize,
  parseFileSize,
  getFileExtension,
  readAsDataURL,
  readAsText,
} from '@oxog/filekit'

React Hooks

import {
  useUploader,
  useDropZone,
  useFileSelect,
  useImagePreview,
} from '@oxog/filekit/react'

React Components

import {
  DropZone,
  FileInput,
  FileList,
  UploadProgress,
  ImagePreview,
} from '@oxog/filekit/react'

Configuration

Uploader Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | endpoint | string \| function | Required | Upload URL | | maxFileSize | number | Infinity | Max file size in bytes | | allowedTypes | string[] | ['*/*'] | Allowed MIME types | | maxFiles | number | Infinity | Max number of files | | autoUpload | boolean | false | Auto upload when files added | | sequential | boolean | false | Upload files one at a time | | headers | object \| function | {} | Custom request headers | | withCredentials | boolean | false | Include cookies in requests | | retries | number | 0 | Number of retry attempts | | chunked | ChunkedConfig | - | Chunked upload configuration |

Chunked Upload Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | enabled | boolean | false | Enable chunked uploads | | chunkSize | number | 5MB | Size of each chunk | | parallel | number | 3 | Parallel chunk uploads | | retries | number | 3 | Retries per chunk | | minSize | number | 10MB | Min file size for chunking |

Events

Uploader Events

uploader.on('add', (file) => {})
uploader.on('start', (file) => {})
uploader.on('progress', (file) => {})
uploader.on('complete', (file) => {})
uploader.on('error', (file, error) => {})
uploader.on('cancel', (file) => {})
uploader.on('allComplete', () => {})

Drop Zone Events

dropzone.on('drop', (files) => {})
dropzone.on('dragenter', () => {})
dropzone.on('dragleave', () => {})
dropzone.on('error', (error) => {})

Browser Support

  • Chrome 60+
  • Firefox 55+
  • Safari 12+
  • Edge 79+

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request