Returns true if the path exists on disk. Behind the scenes it uses
static exists(path: string): boolean;
||The absolute or relative path to the filesystem object.|
There is a debate about the fact that after
fs.existsSync() returns true, the file might be deleted before fs.readSync() is called, which would imply that everybody should catch a
readSync() exception, and nobody should ever use
fs.existsSync(). We find this to be unpersuasive, since “unexceptional exceptions” really hinder the break-on-exception debugging experience. Also, throwing/catching is generally slow.