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

@miinded/nestjs-s3

v1.0.0

Published

Production-ready NestJS module for AWS S3, MinIO, and S3-compatible object storage. Features automatic bucket creation, presigned URLs, streaming uploads, and full TypeScript support.

Readme

@miinded/nestjs-s3

npm version License: MIT

Production-ready NestJS module for AWS S3, MinIO, and S3-compatible object storage. Features automatic bucket creation, presigned URLs, streaming uploads, and full TypeScript support.

Features

  • 🚀 Easy Integration - Simple module registration with sync and async configuration
  • 🔒 Public & Private Files - Built-in support for public and private file uploads
  • 🔗 Presigned URLs - Generate secure time-limited download links
  • 📦 Streaming Support - Memory-efficient streaming for large files
  • 🪣 Auto Bucket Creation - Automatically creates buckets if they don't exist
  • 📝 Full TypeScript - Complete type definitions for excellent DX
  • Well Tested - Unit, integration, and E2E tests

Installation

npm install @miinded/nestjs-s3
# or
pnpm add @miinded/nestjs-s3
# or
yarn add @miinded/nestjs-s3

Quick Start

AWS S3

import { Module } from '@nestjs/common';
import { S3Module, S3Service } from '@miinded/nestjs-s3';

@Module({
  imports: [
    S3Module.register({
      accessKeyId: process.env.AWS_ACCESS_KEY_ID,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
      endpoint: 'https://s3.amazonaws.com',
      region: process.env.AWS_REGION,
      bucket: process.env.S3_BUCKET,
    }),
  ],
  providers: [FileService],
})
export class AppModule {}

MinIO (Self-hosted)

import { S3Module } from '@miinded/nestjs-s3';

@Module({
  imports: [
    S3Module.register({
      accessKeyId: 'minioadmin',
      secretAccessKey: 'minioadmin',
      endpoint: 'http://localhost:9000',
      region: 'us-east-1',
      bucket: 'my-app-bucket',
    }),
  ],
})
export class AppModule {}

Async Configuration

import { ConfigModule, ConfigService } from '@nestjs/config';
import { S3Module } from '@miinded/nestjs-s3';

@Module({
  imports: [
    ConfigModule.forRoot(),
    S3Module.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (config: ConfigService) => ({
        accessKeyId: config.getOrThrow('AWS_ACCESS_KEY_ID'),
        secretAccessKey: config.getOrThrow('AWS_SECRET_ACCESS_KEY'),
        endpoint: config.get('S3_ENDPOINT', 'https://s3.amazonaws.com'),
        region: config.getOrThrow('AWS_REGION'),
        bucket: config.getOrThrow('S3_BUCKET'),
      }),
    }),
  ],
})
export class AppModule {}

Usage Example

import { Injectable } from '@nestjs/common';
import { InjectS3, S3Service } from '@miinded/nestjs-s3';

@Injectable()
export class FileService {
  constructor(@InjectS3() private readonly s3: S3Service) {}

  async uploadAvatar(userId: string, file: Express.Multer.File) {
    const key = `avatars/${userId}/${file.originalname}`;
    await this.s3.uploadPrivateFile(key, file.buffer, file.mimetype);
    return key;
  }

  async getAvatarUrl(userId: string, filename: string) {
    return this.s3.getLink(`avatars/${userId}/${filename}`);
  }

  async deleteAvatar(userId: string, filename: string) {
    await this.s3.delete(`avatars/${userId}/${filename}`);
  }
}

API Reference

| Method | Description | Returns | | ---------------------------------------------- | --------------------- | ------------------------------ | | uploadFile(key, buffer, mimeType, isPublic?) | Upload a file | Promise<UploadResult> | | uploadPublicFile(key, buffer, mimeType) | Upload a public file | Promise<UploadResult> | | uploadPrivateFile(key, buffer, mimeType) | Upload a private file | Promise<UploadResult> | | download(key) | Download file content | Promise<Uint8Array> | | getStream(key) | Get readable stream | Promise<Readable> | | exists(key) | Check if file exists | Promise<boolean> | | getLink(key) | Get presigned URL | Promise<string> | | listFiles(path) | List files in path | Promise<{name, size, key}[]> | | delete(key) | Delete a file | Promise<void> |

Configuration Options

| Option | Type | Required | Description | | ----------------- | -------- | -------- | --------------------- | | accessKeyId | string | ✅ | AWS access key ID | | secretAccessKey | string | ✅ | AWS secret access key | | endpoint | string | ✅ | S3 endpoint URL | | region | string | ✅ | AWS region | | bucket | string | ✅ | Bucket name |

Compatible Services

  • AWS S3
  • MinIO
  • DigitalOcean Spaces
  • Wasabi
  • Cloudflare R2
  • Any S3-compatible storage

License

MIT © Miinded