UNPKG

@inlang/paraglide-js

Version:

[![NPM Downloads](https://img.shields.io/npm/dw/%40inlang%2Fparaglide-js?logo=npm&logoColor=red&label=npm%20downloads)](https://www.npmjs.com/package/@inlang/paraglide-js) [![GitHub Issues](https://img.shields.io/github/issues-closed/opral/paraglide-js?lo

24 lines 561 B
/** * Returns true if the path exists (file or directory), false otherwise. * * @param nodeishFs * @returns */ export async function pathExists(filePath, fs) { try { await fs.stat(filePath); return true; } catch (error) { //@ts-expect-error - error is Error if (error.code === "ENOENT") { return false; } else { throw new Error(`Failed to check if path exists: ${error}`, { cause: error, }); } } } //# sourceMappingURL=exists.js.map