UNPKG

@equinor/fusion-framework-cli

Version:

[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](./LICENSE)

27 lines 621 B
import { accessSync, constants } from 'node:fs'; import { access } from 'node:fs/promises'; export const fileExistsSync = (file, options) => { try { accessSync(file, constants.F_OK); return true; } catch (err) { if (options?.assert) { throw err; } return false; } }; export const fileExists = async (file, options) => { try { await access(file, constants.F_OK); return true; } catch (err) { if (options?.assert) { throw err; } return false; } }; //# sourceMappingURL=file-exists.js.map