function StoragePlugin
StoragePlugin(options?: StoragePluginOptions): IPlugin

Creates the StoragePlugin.

Registers an IStorage under CAPABILITIES.STORAGE. The default provider is 'memory' (zero dependency, every runtime).

Examples

Example 1

import { StoragePlugin } from '@setu-ts/storage-plugin';

// In-memory (default)
app.register(StoragePlugin());

// AWS S3
app.register(StoragePlugin({
  provider: 's3',
  options: { bucket: 'my-bucket', region: 'us-east-1' },
}));

Parameters

optional
options: StoragePluginOptions

Plugin configuration

Return Type

IPlugin

The plugin instance

Usage

import { StoragePlugin } from "storage-plugin/src/index.ts";