Registry / storage / nestjs-minio

nestjs-minio

JSON →
library2.8.0jsnpmunverified

A NestJS module integrating MinIO object storage (v2.8.0, stable, monthly releases). Provides a NestJS-style DI wrapper around the MinIO JavaScript client, supporting global configuration, multiple named clients, and decorator-based injection. Compatible with NestJS 7+. Differentiated from raw minio usage by seamless integration with NestJS modules and dependency injection.

npm install nestjs-minio
INSTALL
IMPORT
SIG · NESTJS-MINIO
N
nestjs-minio
storagejavascriptv2.8.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NestMinioModule
import { NestMinioModule } from 'nestjs-minio'
const NestMinioModule = require('nestjs-minio');
ESM-only; use dynamic import for CJS.
MINIO_CONNECTION
import { MINIO_CONNECTION } from 'nestjs-minio'
import { MINIO_CONNECTION } from 'nestjs-minio/dist/...'
Available as top-level export from index.
InjectMinioClient
import { InjectMinioClient } from 'nestjs-minio'
import { Inject } from '@nestjs/common' with custom token
Decorator for named clients; use with name argument e.g. @InjectMinioClient('uploads').

Registers the MinIO module with credentials; then inject the client using @Inject(MINIO_CONNECTION) or @InjectMinioClient().

import { Module } from '@nestjs/common'; import { NestMinioModule } from 'nestjs-minio'; @Module({ imports: [ NestMinioModule.register({ isGlobal: true, endPoint: 'play.min.io', port: 9000, useSSL: true, accessKey: 'Q3AM3UQ867SPQQA43P2F', secretKey: 'zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG', }), ], }) export class AppModule {}
Debug
Known issues
breakingMINIO_CONNECTION token changed from 'MINIO_CONNECTION' to a Symbol('MINIO_CONNECTION') in v2.0.0.
fix
Use the exported MINIO_CONNECTION constant from the package; do not hardcode strings.
affects: >=2.0.0
deprecatedNestMinioModule.registerAsync() is deprecated in favor of register() with factory pattern.
fix
Use NestMinioModule.register({ ... }); support for async config may be added via useFactory.
affects: <2.0.0
gotchaIf you register multiple named clients, you must import the module twice with different 'name' properties; injecting without a name gives the default unnamed client.
fix
Use @InjectMinioClient('name') for named clients.
affects: >=1.0.0
gotchaThe option 'isGlobal: true' makes the module available application-wide; omitting it requires manual export.
fix
Either set isGlobal: true or export the module explicitly.
affects: >=1.1.0
Errors
Common errors & fixes
NestMinioModule is not a function
Using CommonJS require instead of ESM import.
fix
Use 'import { NestMinioModule } from "nestjs-minio"' or use dynamic import.
Cannot find name 'MINIO_CONNECTION'
Misspelled or not imported correctly.
fix
Import { MINIO_CONNECTION } from 'nestjs-minio'.
Invalid options passed to NestMinioModule.register()
Options object does not include required 'endPoint', 'accessKey', 'secretKey' fields.
fix
Ensure all required fields are present (see README).
Upgrade
Version history
2.8.0latest on npm
Audit
Dependencies
@nestjs/commonrequiredPeer dependency for NestJS module and injection decorators
@nestjs/corerequiredPeer dependency for NestJS module system
Agent activity
31 hits · last 30 days
node
28
Amazon
1
OpenAI (training)
1
Resources
nestjs-minio — npm install nestjs-minio · libregistry