UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

21 lines (18 loc) 637 B
import { accessSync } from 'node:fs'; import { toPath } from '@visulima/path/utils'; import { F_OK } from './F_OK-JER1LjUr.mjs'; import assertValidFileOrDirectoryPath from './assertValidFileOrDirectoryPath-BWWgA1wj.mjs'; var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); function isAccessibleSync(path, mode = F_OK) { assertValidFileOrDirectoryPath(path); path = toPath(path); try { accessSync(path, mode); return true; } catch { return false; } } __name(isAccessibleSync, "isAccessibleSync"); export { isAccessibleSync as default };