package
Check if a path is a file, directory, or symlink
npm install path-typeGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
5.2 kB
Includes dependencies.
Check if a path is a file, directory, or symlink
npm install path-typeimport {isFile} from 'path-type';
console.log(await isFile('package.json'));
//=> trueCheck whether the passed path is a file.
Returns a Promise<boolean>.
Type: string
The path to check.
Check whether the passed path is a directory.
Returns a Promise<boolean>.
Check whether the passed path is a symlink.
Returns a Promise<boolean>.
Synchronously check whether the passed path is a file.
Returns a boolean.
Synchronously check whether the passed path is a directory.
Returns a boolean.
Synchronously check whether the passed path is a symlink.
Returns a boolean.