Storage
@veloxts/storage provides unified file storage.
Installation
Section titled “Installation”pnpm add @veloxts/storageQuick Start
Section titled “Quick Start”import { storagePlugin } from '@veloxts/storage';
app.register(storagePlugin, { driver: 'local', config: { root: './uploads', baseUrl: '/files', },});Basic Usage
Section titled “Basic Usage”// Uploadawait ctx.storage.put('avatars/user-123.jpg', buffer, { visibility: 'public',});
// Get URLconst url = await ctx.storage.url('avatars/user-123.jpg');
// Stream large filesconst stream = await ctx.storage.stream('large-file.zip');
// Deleteawait ctx.storage.delete('old-file.pdf');
// Check existenceconst exists = await ctx.storage.exists('avatars/user-123.jpg');Drivers
Section titled “Drivers”storagePlugin({ driver: 'local', config: { root: './uploads', baseUrl: '/files' },})storagePlugin({ driver: 's3', config: { bucket: 'my-bucket', region: 'us-east-1', accessKeyId: process.env.AWS_KEY, secretAccessKey: process.env.AWS_SECRET, },})Signed URLs
Section titled “Signed URLs”const signedUrl = await ctx.storage.temporaryUrl( 'private/document.pdf', { expiresIn: '1h' });Next Steps
Section titled “Next Steps”- Ecosystem Overview - All packages