UNPKG

@nathanfaucett/file_utils

Version:
20 lines (16 loc) 416 B
var fs = require("fs"), diveSync = require("./diveSync"); module.exports = removeSync; function removeSync(path) { var stat = fs.statSync(path); if (stat.isDirectory()) { diveSync(path, { directories: true, all: true }, function onAction( file ) { removeSync(file.path); }); fs.rmdirSync(path); } else { fs.unlinkSync(path); } }