Synchronous rmdir(2). Returns undefined.
rmdir(2)
undefined
Using fs.rmdirSync() on a file (not a directory) results in an ENOENT error on Windows and an ENOTDIR error on POSIX.
fs.rmdirSync()
ENOENT
ENOTDIR
To get a behavior similar to the rm -rf Unix command, use rmSync with options { recursive: true, force: true }.
rm -rf
{ recursive: true, force: true }
Optional
v0.1.21
Synchronous
rmdir(2). Returnsundefined.Using
fs.rmdirSync()on a file (not a directory) results in anENOENTerror on Windows and anENOTDIRerror on POSIX.To get a behavior similar to the
rm -rfUnix command, use rmSync with options{ recursive: true, force: true }.