@equinor/fusion-framework-cli
Version:
[](./LICENSE)
27 lines • 621 B
JavaScript
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