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

nest-background-file-upload

v1.0.1

Published

A NestJS package for background file uploads with support for multiple cloud storage providers and optional file compression.

Readme

Common Background File Upload Package

Overview

The Common Background File Upload Package provides functionality to upload multiple files to various storage services seamlessly in the background. This ensures efficient file handling and improves application performance by offloading the upload process.

🚨 Redis is mandatory for background task management. Without Redis, the package will not function as expected. It ensures smooth processing, queuing, and tracking of file uploads.

Supported storage platforms include:

  • Local Server
  • Google Cloud Platform (GCP)
  • Amazon Web Services (AWS) (Currently Under Maintenance)
  • Azure (Currently Under Maintenance)

This package also supports optional file compression (Under Maintenance) by specifying a dynamic quality ratio based on file size.


Installation

To install the package, use the following command:

npm install nest-background-file-upload

Ensure that you have the necessary dependencies installed based on your storage provider. Redis is a required dependency for background task management. You must have a Redis server running to use this package.


Configuration and Usage

To enable background file uploading, register the FileUploaderModule in your application module with the desired storage configuration.

🚀 Redis Configuration (Required)

Redis is required to manage background file uploads efficiently. Below is the standard configuration:

const redisConfiguration = {
  host: 'localhost', // Redis server host
  port: 6379, // Redis server port
  password: 'your-redis-password', // Optional Redis password
  db: 0, // Redis database index
}

Local Server Storage

import { FileUploaderModule } from 'nest-background-file-upload';

@Module({
  imports: [
    FileUploaderModule.register({
      redis: redisConfiguration,
      storageType: 'local',
      localPath: 'path-to-upload-folder',
    }),
  ],
})
export class AppModule {}

Google Cloud Platform (GCP) Storage

import { FileUploaderModule } from 'nest-background-file-upload';

@Module({
  imports: [
    FileUploaderModule.register({
      redis: redisConfiguration,
      storageType: 'gcp',
      gcp: {
        bucketName: 'cloud-bucket-name',
        credentials: 'gcp-credentials-json-object',
      },
    }),
  ],
})
export class AppModule {}

Amazon Web Services (AWS) S3 Storage (Under Maintenance)

import { FileUploaderModule } from 'nest-background-file-upload';

@Module({
  imports: [
    FileUploaderModule.register({
      redis: redisConfiguration,
      storageType: 's3',
      s3: {
        accessKeyId: 'your-access-key-id',
        secretAccessKey: 'your-secret-access-key',
        region: 'your-region',
        bucket: 'your-bucket-name',
      },
    }),
  ],
})
export class AppModule {}

Microsoft Azure Blob Storage (Under Maintenance)

import { FileUploaderModule } from 'nest-background-file-upload';

@Module({
  imports: [
    FileUploaderModule.register({
      redis: redisConfiguration,
      storageType: 'azure',
      azure: {
        connectionString: 'azure-connection-string',
        containerName: 'storage-container-name',
      },
    }),
  ],
})
export class AppModule {}

Dynamic File Compression (Under Maintenance)

You can enable dynamic file compression by specifying quality ratios based on file size. This helps optimize storage while maintaining file quality.

import { FileUploaderModule } from 'nest-background-file-upload';

@Module({
  imports: [
    FileUploaderModule.register({
      redis: redisConfiguration,
      compressionNeeded: true,
      compressionRatio: [
        { fileSize: [0, 500000], ratio: 90 }, // 90% quality for files ≤ 500KB
        { fileSize: [500001, 2000000], ratio: 70 }, // 70% quality for files between 500KB - 2MB
        { fileSize: [2000001, Infinity], ratio: 50 }, // 50% quality for files > 2MB
      ],
    }),
  ],
})
export class AppModule {}

Features

  • ✅ Supports multiple storage providers
  • Asynchronous background uploads for performance optimization
  • Redis is mandatory for background task handling and tracking
  • Modular and scalable integration for NestJS applications
  • Easy configuration for different cloud platforms
  • Handles multiple file uploads efficiently
  • Supports conditional file compression (Under Maintenance) based on file size ranges
  • Tracks upload progress using Redis for better monitoring

Roadmap

  • ✅ Support for Local and GCP storage
  • 🔧 AWS and Azure support (Currently under maintenance)
  • 🚀 Future enhancements including file processing, metadata handling, and enhanced error tracking