@opengis/fastify-table
Version:
core-plugins
16 lines (15 loc) • 387 B
JavaScript
import { stat } from "node:fs/promises";
import getPath from "./getPath.js";
const isFileExists = async (filepath) => {
const fullPath = getPath(filepath, { check: true });
if (!fullPath)
return false;
try {
const stats = await stat(fullPath);
return stats.isFile();
}
catch (err) {
return false;
}
};
export default isFileExists;