Unified TypeScript file management across multiple storage providers — with strongly-typed native provider options preserved instead of flattened into a lowest-common-denominator API.
import { createStorage } from '@mohamedhabibwork/storagekit';
const storage = await createStorage({
type: 's3',
bucket: 'uploads',
region: 'eu-central-1',
});
await storage.upload('users/100/avatar.jpg', fileStream, {
contentType: 'image/jpeg',
// normalized, works on every provider
cacheControl: 'public,max-age=31536000',
// real AWS options, typed per storage type
native: {
StorageClass: 'INTELLIGENT_TIERING',
ServerSideEncryption: 'AES256',
},
});
Change type: 's3' to type: 'azure' and TypeScript now offers
Azure-native options (tier: 'Cool', SAS conditions, …) — and rejects
AWS ones.
| If you want to… | Read |
|---|---|
| Use the on-disk filesystem | Local driver |
| Talk to AWS S3 | AWS S3 driver |
| Talk to MinIO | MinIO driver |
| Talk to Azure Blob | Azure Blob driver |
| Talk to Oracle OCI Object Storage | Oracle OCI driver |
| Talk to RustFS (S3-compatible, Rust) | RustFS driver |
| Talk to Cloudflare R2 | Cloudflare R2 driver |
| Talk to Google Cloud Storage | GCS driver |
| Add your own backend | Custom drivers |
| Handle multipart uploads from Express, Fastify, Hono, Next.js, … | Framework uploads |
The full API surface — normalized options, native per-driver overrides,
streaming, signed URLs — is described in each driver’s page.