fsPromises.rmdir(path[, options])
Stability: 1 - Recursive removal is experimental.
path
<string> | <Buffer> | <URL>options
<Object>maxRetries
<integer> If anEBUSY
,EMFILE
,ENFILE
,ENOTEMPTY
, orEPERM
error is encountered, Node.js will retry the operation with a linear backoff wait ofretryDelay
ms longer on each try. This option represents the number of retries. This option is ignored if therecursive
option is nottrue
. Default:0
.recursive
<boolean> Iftrue
, perform a recursive directory removal. In recursive mode, errors are not reported ifpath
does 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 therecursive
option 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.