Skip to content

Universal Storage API Reference

Creates an initialized storage driver instance according to the provided configuration.

function createStorage(config: StorageConfig): StorageDriver
Parameter Type Required Description
config StorageConfig Yes Storage driver options (driver type, credentials, root path).
  • Type: StorageDriver
  • Description: Storage driver instance implementing read, write, delete, and list.
import { createStorage } from '@alneas/universal-storage';
const storage = createStorage({ driver: 'fs', rootDir: './data' });
await storage.write('state.json', '{}');