UNPKG

nope.db

Version:

A modern, simple, and async JSON database for Node.js with zero dependencies and a data-safe queue.

35 lines (34 loc) 978 B
export interface ClearOptions { confirm: boolean; } interface StorageManagerSettings { file: string; spaces: number; separator: string; } export declare class StorageManager { private file; private spaces; private separator; private queue; private errors; constructor(settings: StorageManagerSettings); private _enqueue; private _read; private _write; private _validateID; private _find; private _findAndSet; set(id: string, value: any): Promise<any>; get(id: string): Promise<any>; add(id: string, value: number): Promise<number>; subtract(id: string, value: number): Promise<number>; all(): Promise<any>; has(id: string): Promise<boolean>; delete(id: string): Promise<boolean>; clear(options: ClearOptions): Promise<true>; push(id: string, value: any): Promise<any[]>; backup(filePath: string): Promise<true>; loadBackup(filePath: string): Promise<true>; } export {};