lhl 93e14fcec2 8-18-1 | 1 year ago | |
---|---|---|
.. | ||
index.d.ts | 1 year ago | |
index.js | 1 year ago | |
license | 1 year ago | |
package.json | 1 year ago | |
readme.md | 1 year ago |
Check if a path is a file, directory, or symlink
$ npm install path-type
const {isFile} = require('path-type');
(async () => {
console.log(await isFile('package.json'));
//=> true
})();
Check 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
.
MIT © Sindre Sorhus