remove dir nodejs code example
Example 1: delete dir nodejs
fs.rmdirSync(dir, { recursive: true });
Example 2: nodejs fs delete non empty directory
var rimraf = require("rimraf");
rimraf("/some/directory", function () { console.log("done"); });
fs.rmdirSync(dir, { recursive: true });
var rimraf = require("rimraf");
rimraf("/some/directory", function () { console.log("done"); });