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-image-upload

v1.0.10

Published

Image upload library for local, aws, gcp or azure storage.

Readme

Common Image Upload Package

Overview

The Common Image Upload Package provides functionality to upload multiple image files to various storage services seamlessly. 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 image compression by specifying a dynamic quality ratio based on image size.


Installation

To install the package, use the following command:

npm install nest-image-upload

Ensure that you have the necessary dependencies installed based on your storage provider.


Configuration and Usage

To enable image uploading, register the ImageUploaderModule in your application module with the desired storage configuration.

Local Server Storage

import { ImageUploaderModule } from 'nest-image-uploader';

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

Google Cloud Platform (GCP) Storage

import { ImageUploaderModule } from 'nest-image-uploader';

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

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

import { ImageUploaderModule } from 'nest-image-uploader';

@Module({
  imports: [
    ImageUploaderModule.register({
      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 { ImageUploaderModule } from 'nest-image-uploader';

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

Dynamic Image Compression

You can enable dynamic image compression by specifying quality ratios based on file size:

import { ImageUploaderModule } from 'nest-image-uploader';

@Module({
  imports: [
    ImageUploaderModule.register({
      // Other storage config
      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 {}

Upload Functionality

Once the module is registered, you can inject the ImageUploaderService into your service class to handle image uploads.

@Injectable()
export class YourService {
  constructor(private readonly imageUploaderService: ImageUploaderService) {}

  async uploadImage(files: Express.Multer.File[]): Promise<string[]> {
    return this.imageUploaderService.upload(files);
  }
}

Features

  • ✅ Supports multiple storage providers
  • Modular and scalable integration for NestJS applications
  • Easy configuration for different cloud platforms
  • Handles multiple file uploads efficiently
  • Supports conditional image compression based on file size ranges

Roadmap

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