@stryke/fs
Version:
A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.
26 lines (24 loc) • 672 B
JavaScript
import { existsSync as existsSync$1 } from "node:fs";
import { access, constants as constants$1 } from "node:fs/promises";
//#region src/exists.ts
/**
* Check if a file exists
*
* @param filePath - The file path to check
* @returns An indicator specifying if the file exists
*/
function existsSync(filePath) {
return existsSync$1(filePath);
}
/**
* Check if a file exists
*
* @param filePath - The file path to check
* @returns An indicator specifying if the file exists
*/
async function exists(filePath) {
return access(filePath, constants$1.F_OK).then(() => true).catch(() => false);
}
//#endregion
export { exists, existsSync };
//# sourceMappingURL=exists.mjs.map