This article mainly introduces node. fs. rmdirSync method usage instructions. This article introduces fs. rmdirSync method description, syntax, receive parameters, use instances, and implement source code. For more information, see
Method description:
The synchronous version of rmdir ().
If the returned value is null or undefined, the deletion is successful. Otherwise, an exception is thrown.
Syntax:
The code is as follows:
Fs. rmdirSync (path)
Because this method belongs to the fs module, we need to introduce the fs module (var fs = require ("fs") before use "))
Receiving parameters:
Path directory path
Example:
The code is as follows:
Var fs = require ('Fs ');
Var deldir = fs. rmdirSync ('deldir ');
Console. log (deldir );
Source code:
The code is as follows:
Fs. rmdirSync = function (path ){
NullCheck (path );
Return binding. rmdir (pathModule. _ makeLong (path ));
};