fs.exists has been deprecated, you can use fs.access to determine whether the folder exists
Using fs.access() to check the accessibility of a file before calling fs.open(), fs.readFile(), or fs.writeFile() is not recommended. Doing so would create a panic condition because other processes might change the state of the file between the two calls. Instead, user code should open/read/write the file directly, and handle errors when the file is inaccessible.