S3 Compatible Cloud Storage client for JavaScript/TypeScript
npx @tessl/cli install tessl/npm-minio@8.0.0Package: minio
Version: 8.0.5
Type: JavaScript/TypeScript library for S3-compatible cloud storage
License: Apache 2.0
The MinIO JavaScript client library provides comprehensive functionality for interacting with MinIO and Amazon S3 compatible cloud storage services. It offers both callback-based and Promise-based APIs, supporting Node.js and browser environments.
npm install minio// Main client class
import { Client } from 'minio'
// Helper classes for advanced operations
import { CopySourceOptions, CopyDestinationOptions } from 'minio'
// Policy and conditions
import { PostPolicy, CopyConditions } from 'minio'
// Notification system
import { NotificationConfig, TopicConfig, QueueConfig, CloudFunctionConfig } from 'minio'
// Credential providers
import { CredentialProvider, AssumeRoleProvider, IamAwsProvider } from 'minio'
// Error classes
import {
S3Error,
InvalidArgumentError,
InvalidBucketNameError,
InvalidObjectNameError
} from 'minio'
// Types and enums
import {
ENCRYPTION_TYPES,
LEGAL_HOLD_STATUS,
RETENTION_MODES,
RETENTION_VALIDITY_UNITS
} from 'minio'import { Client } from 'minio'
// Create client instance
const minioClient = new Client({
endPoint: 'play.min.io',
port: 9000,
useSSL: true,
accessKey: 'your-access-key',
secretKey: 'your-secret-key'
})
// Basic operations
async function basicOperations() {
// Create bucket
await minioClient.makeBucket('test-bucket', 'us-east-1')
// Upload object
const uploadInfo = await minioClient.putObject(
'test-bucket',
'test.txt',
'Hello MinIO!'
)
// Download object
const stream = await minioClient.getObject('test-bucket', 'test.txt')
// Get object metadata
const stat = await minioClient.statObject('test-bucket', 'test.txt')
// List objects
const objectStream = minioClient.listObjects('test-bucket')
objectStream.on('data', obj => console.log(obj))
}The MinIO JavaScript client follows a modular architecture:
Client Class - Main entry point extending TypedClient
Credential Management - Flexible authentication
Helper Classes - Advanced functionality
Error Handling - Comprehensive error types
This documentation is organized into focused sections:
The client is compatible with:
The library supports both patterns:
// Promise-based (recommended)
const result = await minioClient.listBuckets()
// Callback-based (legacy support)
minioClient.listBuckets((err, buckets) => {
if (err) throw err
console.log(buckets)
})