const exist = require('@does/exist'); const fileExists = await exist(join(__dirname, 'index.js'));
false
true
Will log error messages when trying to access a file that's not there
await exist(path, {quiet: false});