The fs.exists() method is used to check if a file or directory exists at a given path. It takes a path as an argument and invokes a callback function with a boolean value indicating whether the path exists or not.
0-2 years experience
8+ years experience