services/disk.js
// Delete all items in a directory.
Delete all items in a directory.
Delete all items in a directory .
async function deleteItemsInDir(path) {
  const contents = fs.readdirSync(path);
  for (const item of contents) {
    const curPath = path + '/' + item;
    if (fs.statSync(curPath).isDirectory()) {
      deleteFolderRecursive(curPath);
    } else {
      fs.unlinkSync(curPath);
    }
  }
}
async function deleteItemsInDir ( path ) { const contents = fs . readdirSync ( path ) ; for ( const item of contents ) { const curPath = path + '/' + item ; if ( fs . statSync ( curPath ) . isDirectory ( ) ) { deleteFolderRecursive ( curPath ) ; } else { fs . unlinkSync ( curPath ) ; } } }
Delete all items in a directory.
Delete all items in a directory .