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

uploadex

v1.0.0

Published

Uploadex is a provider-agnostic, production-ready file upload module for NestJS. Built with a stream-first engine, strict validation, and support for S3, GCS, Azure, Cloudinary, and local uploads — all with one config, one line, and total control.

Downloads

58

Readme

Uploadex – The Ultimate File Upload Engine for NestJS

Uploadex is a provider-agnostic, production-ready file upload module for NestJS. Built with a stream-first engine, strict validation, and support for S3, GCS, Azure, Cloudinary, and local uploads — all with one config, one line, and total control

One config. One interceptor. Total control.


Features

  • [x] Stream-first & buffer-aware upload engine:

    • [x] Upload small files fully in-memory
    • [x] Switch to stream upload automatically for large files
  • [x] Multiple provider support:

    • [x] Local storage (disk)
    • [x] Amazon S3
    • [x] Azure Blob Storage
    • [x] Google Cloud Storage
    • [x] Cloudinary
  • [x] Built-in file validation system:

    • [x] Max file size
    • [x] Allowed MIME types
    • [x] Allowed extensions
    • [x] Allowed number of files
  • [x] Automatic safe upload system:

    • [x] Timeout handling
    • [x] Retry logic
    • [x] Cleanup on failure
  • [x] Signed URL upload support:

    • [x] Azure SAS
    • [x] GCS signed policies
  • [x] Emulator support (for local development):

    • [x] LocalStack (S3)
    • [x] Azurite (Azure)
    • [x] Fake GCS Server
  • [x] Filename sanitization:

    • [x] Safe, collision-free filenames with UUIDs, sanitized characters, and extension preservation
    • [x] Prevents path traversal and ensures cross-platform compatibility
  • [x] Multi-file upload made simple:

    • [x] Single file
    • [x] Multiple files
  • [x] Fully configurable via registerAsync():

    • [x] Dynamic config with ConfigModule
    • [x] Support for any async source (database, .env, etc.)
  • [x] Interceptor-ready usage:

    • [x] @UseInterceptors(UploadexInterceptor)
    • [x] @UploadedFile() / @UploadedFiles()
  • [x] Framework-ready:

    • [x] NestJS DI support
    • [x] Clean provider abstraction
    • [x] Well-typed and modular

Installation

npm install uploadex
# or
yarn add uploadex

Quick Example (Single File)

// uploads.controller.ts
@Post('upload')
@UseInterceptors(UploadexInterceptor('file'))
upload(@UploadedFile() file: Express.Multer.File) {
  return this.uploadexService.handleSingleFileUpload(file);
}

Configuration (Using ConfigModule)

import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { UploadsModule } from 'uploadex';

@Module({
  imports: [
    ConfigModule.forRoot({ isGlobal: true }),
    UploadsModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (config: ConfigService) => ({
        provider: config.get<'s3' | 'azure' | 'gcs' | 'cloudinary' | 'local'>('UPLOAD_PROVIDER'),

        config: {
          bucket: config.get('S3_BUCKET') ?? '',
          region: config.get('S3_REGION') ?? '',
          accessKeyId: config.get('S3_ACCESS_KEY') ?? '',
          secretAccessKey: config.get('S3_SECRET') ?? '',
          endpoint: config.get('S3_ENDPOINT') ?? '', // For emulator or self-hosted S3
        },

        maxFileSize: parseInt(config.get('MAX_FILE_SIZE') ?? '10485760'),        // 10MB
        maxFiles: parseInt(config.get('MAX_FILES') ?? '5'),                      // Up to 5 files
        allowedMimeTypes: ['image/jpeg', 'image/png', 'application/pdf'],       // Accept only specific MIME types
        allowedExtensions: ['.jpg', '.jpeg', '.png', '.pdf'],                   // Restrict to safe extensions
        maxSafeMemorySize: parseInt(config.get('MAX_SAFE_MEMORY_SIZE') ?? '5242880'), // Buffer small files (5MB), stream large
        uploadRetries: parseInt(config.get('UPLOAD_RETRIES') ?? '2'),           // Retry twice on failure
        uploadTimeoutMs: parseInt(config.get('UPLOAD_TIMEOUT_MS') ?? '15000'),  // 15s timeout per upload
        debug: true,                                                             // Enable debug logs
      }),
    }),
  ],
  controllers: [UploadController],
  providers: [UploadService],
})
export class AppModule {}

Go Pro With the Full Docs

See the full documentation → https://www.uploadex.dev

Covers:

  • Usage with all providers
  • Emulator setups (LocalStack, Azurite, etc.)
  • Streaming uploads and memory safety
  • Configuring retries, timeouts, debug
  • Managing env varibales && Error handling in depth
  • Best practices for production

Author

Yassine El IdrissiPortfolio
Creator of Uploadex, passionate about backend architecture and open source.


Support

If Uploadex saved you time — give it a ⭐ on GitHub
Tweet about it. Share it with friends. Help us grow the upload revolution.


License

MIT © 2025 Yassine El Idrissi