Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

How to empty a folder in Node.js

// npm install fs-extra
const fsExtra = require('fs-extra');
const folder = './folder_name';
try {
  fsExtra.emptyDirSync(folder);
} catch(e){ 
  console.log("Error emptying folder!", e); 
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular refresh token 
Javascript :: Looping through LI elements in UL 
Javascript :: array from set javascript 
Javascript :: how to remove an object from jsonobject in java 
Javascript :: generating random number in javascript 
Javascript :: crear proyecto angular 
Javascript :: javascript replace dash with space 
Javascript :: ityped react 
Javascript :: hover effect in material ui 
Javascript :: google maps places autocomplete api 
Javascript :: useSearchParams 
Javascript :: js capitalize first letter 
Javascript :: javascript get device width 
Javascript :: javascript onload complete 
Javascript :: remove local storage item 
Javascript :: toggle checkbox jquery 
Javascript :: set package json to install latest version 
Javascript :: event loop 
Javascript :: sanitizing user input javascript 
Javascript :: how to make one line if in js 
Javascript :: regex is not empty string 
Javascript :: dynamic event listener jquery 
Javascript :: react native strike through text 
Javascript :: js for loop array 
Javascript :: chart.js label word wrap 
Javascript :: Not allowed to navigate top frame to data URL 
Javascript :: show tooltip automatically 
Javascript :: angular stoppropagatio 
Javascript :: cannot use import statement outside a module 
Javascript :: count value a to b character javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =