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

@axiomify/upload

v3.1.0

Published

The official, high-performance multipart file upload plugin for the Axiomify framework.

Readme

@axiomify/upload

The official, high-performance multipart file upload plugin for the Axiomify framework.

@axiomify/upload is built for maximum efficiency and security. It bypasses memory-hogging buffers by streaming multipart/form-data directly to disk, making it completely RAM-safe for massive file payloads.

✨ Features

  • RAM-Safe Streaming: Powered by busboy under the hood. Files are streamed directly to the hard drive or cloud storage buffer, preventing memory exhaustion attacks (OOM).
  • Guaranteed Cleanup: Hooks deep into Axiomify's onError lifecycle phase. If a route handler throws an error, validation fails, or the client aborts the connection, the plugin automatically deletes any orphaned or partially uploaded files.
  • Pre-Validation Hook: Executes perfectly during the preHandler phase, meaning req.body (text fields) and req.files (streams) are fully populated before your Zod schemas execute.
  • Adapter Agnostic: Seamlessly handles streams from Express, Fastify, Hapi, and native HTTP.

📦 Installation

Ensure you install the upload plugin alongside the Axiomify core and the underlying Busboy engine:

npm install @axiomify/upload @axiomify/core busboy zod

🚀 Quick Start

Attaching the upload engine to your Axiomify instance handles all the complex streaming logistics automatically.

import { Axiomify } from '@axiomify/core';
import { useUpload } from '@axiomify/upload';
import { z } from 'zod';

// 1. Initialize the Axiomify Core Engine
const app = new Axiomify();

// 2. Attach the Upload Plugin
// This registers the 'preHandler' streaming parser and the 'onError' cleanup hook
useUpload(app, {
  dest: './tmp/uploads', // Local directory for streamed files
  limits: {
    fileSize: 10 * 1024 * 1024, // 10MB limit per file
    files: 5 // Maximum of 5 files per request
  }
});

// 3. Register your routes
app.route({
  method: 'POST',
  path: '/users/avatar',
  schema: {
    // Standard text fields are automatically parsed from the multipart form
    body: z.object({
      userId: z.string() 
    })
  },
  handler: async (req, res) => {
    // The plugin safely attaches the completed file metadata to req.files
    const avatar = req.files['avatar'];
    const { userId } = req.body;

    if (!avatar) {
      // If we throw here, the 'onError' hook automatically deletes 
      // any other files that may have been uploaded in this request!
      return res.status(400).send({ error: 'Avatar file is required' });
    }

    return res.status(200).send({ 
      success: true, 
      message: `Avatar for ${userId} safely streamed to ${avatar.path}` 
    });
  }
});

// 4. Mount to your preferred adapter
// await app.handle(req, res);

📚 Documentation

For complete documentation, guides, and advanced plugin authoring, please visit the Axiomify Master Repository.

📄 License

MIT