setup-node/node_modules/path-type
eric sciple e7ed525da5 .
2020-01-24 16:30:50 -05:00
..
index.js . 2020-01-24 16:30:50 -05:00
license . 2020-01-24 16:30:50 -05:00
package.json . 2020-01-24 16:30:50 -05:00
readme.md . 2020-01-24 16:30:50 -05:00

path-type Build Status

Check if a path is a file, directory, or symlink

Install

$ npm install path-type

Usage

const pathType = require('path-type');

pathType.file('package.json').then(isFile => {
	console.log(isFile);
	//=> true
})

API

.file(path)

.dir(path)

Returns a Promise for a boolean of whether the path is the checked type.

.fileSync(path)

.dirSync(path)

.symlinkSync(path)

Returns a boolean of whether the path is the checked type.

License

MIT © Sindre Sorhus