stormflow
Version:
StormFlow is a versatile Node.js data management library designed for efficient data management.
29 lines (26 loc) • 918 B
TypeScript
/**
* Options for instantiating the fileStorageAdapter.
*/
export interface FileStorageAdapterOptions {
/** Path to the data folder (default: './data') */
dataFolder?: string;
/** Write throttling time in ms (default: 100) */
throttle?: number;
/** Enable verbose logging */
verbose?: boolean;
}
/**
* File-based storage adapter factory.
* @param options Settings
*/
declare function fileStorageAdapter(options?: FileStorageAdapterOptions): {
/** Initialize and restore collections */
init: () => Promise<any>;
/** Insert new documents */
insert: (params: { collectionName: string; collectionData: any[] }) => Promise<void>;
/** Update documents */
update: (params: { collectionName: string; collectionData: any[] }) => Promise<void>;
/** Delete documents */
delete: (params: { collectionName: string; collectionData: any[] }) => Promise<void>;
};
export default fileStorageAdapter;