Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

fs clear directory

fs.readdir(dir, (err, files) => {
  if(err) throw err;
  for(const file of files) {
    fs.unlinkSync(path.join(directory, file));
  }
});
 
PREVIOUS NEXT
Tagged: #fs #clear #directory
ADD COMMENT
Topic
Name
5+9 =