file-exists
Check if filepath exists and is a file. Returns false for directories.
(Requires node >=6.0.0)
Install
npm install file-exists --save
Usage
const fileExists = ; // OUTPUTS: true or false console // OUTPUTS: true or false
Options
fileExists(filepath[, options, callback])
filepath
- the path to the file to check if it existsoptions
- an object of optionsroot
- the root directory to look in (or cwd)
callback(err, exists)
- gets called when checking is done
fileExists.sync(filepath[, options])
filepath
- the path to the file to check if it existsoptions
- an object of optionsroot
- the root directory to look in (or cwd)
Run Tests
npm install
npm test