UNPKG

@alwatr/node-fs

Version:

Enhanced file system operations in Node.js with asynchronous queue to prevent parallel writes.

36 lines 917 B
/** * Enhanced read json file (async). * * @param path - file path * @returns json object * @example * ```typescript * const fileContent = await readJson('./file.json'); * ``` */ export declare function readJson<T extends JsonValue>(path: string): Promise<T>; /** * Enhanced read json file (sync). * * @param path - file path * @param sync - sync mode * @returns json object * @example * ```typescript * const fileContent = readJson('./file.json', true); * ``` */ export declare function readJson<T extends JsonValue>(path: string, sync: true): T; /** * Enhanced read json file. * * @param path - file path * @param sync - sync mode * @returns json object * @example * ```typescript * const fileContent = await readJson('./file.json', sync); * ``` */ export declare function readJson<T extends JsonValue>(path: string, sync: boolean): Awaitable<T>; //# sourceMappingURL=read-json.d.ts.map