SyntaxFix
Write A Post
Hire A Developer
Questions
A easier way to do this synchronously.
if (fs.existsSync('/etc/file')) { console.log('Found file'); }
The API doc says how existsSync work: Test whether or not the given path exists by checking with the file system.
existsSync