UNPKG

@stryke/fs

Version:

A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.

30 lines 1.03 kB
//#region src/read-file.d.ts /** * Read the given content to the given file path * * @param filePath - The file path to write to */ declare const readFileSync: (filePath: string) => string; /** * Read the given content to the given file path * * @param filePath - The file path to read to */ declare const readFile: (filePath: string) => Promise<string>; /** * Reads a file if it exists, otherwise returns an empty string. * * @param path - The path to the file to read. * @returns The content of the file if it exists, otherwise an empty string. */ declare function readFileIfExistingSync(path: string): string; /** * Reads a file if it exists, otherwise returns an empty string. * * @param path - The path to the file to read. * @returns The content of the file if it exists, otherwise an empty string. */ declare function readFileIfExisting(path: string): Promise<string>; //#endregion export { readFile, readFileIfExisting, readFileIfExistingSync, readFileSync }; //# sourceMappingURL=read-file.d.mts.map