showing results for - "delete all files in a folder with nodejs"
Félix
27 Oct 2016
1rmDir = function(dirPath, removeSelf) {
2  try { var files = fs.readdirSync(dirPath); }
3  catch(e) { return; }
4  if (files.length > 0)
5    for (var i = 0; i < files.length; i++) {
6      var filePath = dirPath + '/' + files[i];
7      if (fs.statSync(filePath).isFile())
8        fs.unlinkSync(filePath);
9      else
10        rmDir(filePath);
11    }
12  if (removeSelf)
13    fs.rmdirSync(dirPath);
14};
queries leading to this page
javascript remove all files in directoryremove all js files in a directorydelete all file 2f folders in directory node jsremove all files in direcotry nodenode js delete everything in folderfs extra delete files in directoryjavascript delete all files in foldernode js server delete all files in directoryremove all content dir nodedelete all folders and files in a directory in javascriptnode delete all files in dirhow to delete all files in folder node jsdelete all files in a folder with nodejsnode del all filesfs remove all files in directorydelete all files in directory nodedelete all files in a directory javascriptdelete file from folder nodes jsdelete all files in a folder fsnodejs delete all files in directorydelete all files in folder node jsfs remove all files in directory exceptfunction to delete files from folder nodehow to delete all files in a folder in jsfs delete all files and folders in directorydelete all files in directory nodejsnodejs delete folder with filesnode js delete files in directorynodejs delete files in directoryjs delete all files in folderremove all files and folders in a directory nodedelete all files from folder node jsdelete all files from directory nodenode js delete all files in directorydelete all file in folder jsnodejs remove all files in directoryremove all files in a folder nodejsnode js remove all files in directorydelete all files in a folder nodejsnode js delete all files in directorynode js how to delete file in folderjs code to delete all files in a folder upon editfs delete all files in directoryremove all file in folder nodejsnode remove all files in directorydelete all ite in a folder uing fs node jsjavascript remove all files in a folderdelete all content of folder in nodejsdelete all files in a directory node jsnode delete all files in directorydelete all files in a directory nodejsdelete all js files in folderdelete all files in a folder node jsnodejs delete all files in a directoryremove all in folder using fs noejsnodejs fs delete all files in the folder exceptnode js fs delete all files in directoryhow to delete files in folder in node jsrm node files and re installdelete all files in a folder with nodejs