@stryke/fs
Version:
A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.
27 lines (26 loc) • 893 B
TypeScript
/**
* Read the given content to the given file path
*
* @param filePath - The file path to write to
*/
export declare const readFileSync: (filePath: string) => string;
/**
* Read the given content to the given file path
*
* @param filePath - The file path to read to
*/
export 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.
*/
export 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.
*/
export declare function readFileIfExisting(path: string): Promise<string>;