Method description:
Synchronous version of rmdir().
If the return value is null or undefined, it means that the deletion is successful, otherwise an exception will be thrown.
grammar:
The code copy is as follows:
fs.rmdirSync(path)
Since this method belongs to the fs module, it is necessary to introduce the fs module before use (var fs= require("fs") )
Receive parameters:
path directory path
example:
The code copy is as follows:
var fs = require('fs');
var deldir = fs.rmdirSync('deldir');
console.log(deldir);
Source code:
The code copy is as follows:
fs.rmdirSync = function(path) {
nullCheck(path);
return binding.rmdir(pathModule._makeLong(path));
};