Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

fs clear directory

fs.readdir(dir, (err, files) => {
  if(err) throw err;
  for(const file of files) {
    fs.unlinkSync(path.join(directory, file));
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: axio post file 
Javascript :: scroll to top js 
Javascript :: JavaScript Object Constructors 
Javascript :: jquery sibling 
Javascript :: query string from object js 
Javascript :: Disable button if one of the checkboxes are not checked 
Javascript :: column width table react 
Javascript :: buffer in javascript 
Javascript :: capacitor.ionicframework.com to apk 
Javascript :: flutter intl currency 
Javascript :: reverse every word in a string javascript 
Javascript :: how to add property to object in javascript 
Javascript :: js hide div 
Javascript :: base64 to blob 
Javascript :: js platformer 
Javascript :: settimeout function es6 
Javascript :: sequelize sqlite example 
Javascript :: how to render react native app under the status bar 
Javascript :: array map arrow function 
Javascript :: html close tab 
Javascript :: jquery change position animate 
Javascript :: json.stringify vs json.parse 
Javascript :: remove comma from string jquery 
Javascript :: react pass props to child 
Javascript :: loop through an array in js 
Javascript :: build apk from react native 
Javascript :: change select value jquery 
Javascript :: how to pip install jsonlines 
Javascript :: copy to clipboard reatjs 
Javascript :: format date javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =