How do i check the existence of a file?
In the documentation for the module fs there\'s a description of the method fs.exists(path, cal
fs
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