%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/node_modules/pm2/lib/tools/
Upload File :
Create Path :
Current File : //usr/lib/node_modules/pm2/lib/tools/deleteFolderRecursive.js

const fs = require('fs');
const Path = require('path');

const deleteFolderRecursive = function(path) {
  if (fs.existsSync(path)) {
    fs.readdirSync(path).forEach((file, index) => {
      const curPath = Path.join(path, file);
      if (fs.lstatSync(curPath).isDirectory()) { // recurse
        deleteFolderRecursive(curPath);
      } else { // delete file
        fs.unlinkSync(curPath);
      }
    });
    fs.rmdirSync(path);
  }
};

module.exports = deleteFolderRecursive

Zerion Mini Shell 1.0