nodejs - create folder

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.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326763995&siteId=291194637