Check if filepath exists and is a file. Returns false for directories.
npm install file-exists --save
var fileExists = require('file-exists');
console.log(fileExists('/index.html')) // OUTPUTS: true or false
filepath
- the path to the file to check if it existsoptions
- an object of optionsroot
- the root directory to look in (or cwd)
npm install
npm test