You could use `fs.exists` and make this whole function async.