fsPromises.rmdir(path[, options])
Stability: 1 - Recursive removal is experimental.
path<string> | <Buffer> | <URL>options<Object>maxRetries<integer> If anEBUSY,EMFILE,ENFILE,ENOTEMPTY, orEPERMerror is encountered, Node.js will retry the operation with a linear backoff wait ofretryDelayms longer on each try. This option represents the number of retries. This option is ignored if therecursiveoption is nottrue. Default:0.recursive<boolean> Iftrue, perform a recursive directory removal. In recursive mode, errors are not reported ifpathdoes not exist, and operations are retried on failure. Default:false.retryDelay<integer> The amount of time in milliseconds to wait between retries. This option is ignored if therecursiveoption is nottrue. Default:100.
- Returns: <Promise>
Removes the directory identified by path then resolves the Promise with
no arguments upon success.
Using fsPromises.rmdir() on a file (not a directory) results in the
Promise being rejected with an ENOENT error on Windows and an ENOTDIR
error on POSIX.