xxxxxxxxxx
rm -f filename(s)
rm -r dirname
rm -rf dirname
xxxxxxxxxx
import del from 'del';
async function removeDir() {
try {
await del([`${dirPath}/*`]);
console.log('Files in directory successfully deleted.');
} catch (err) {
console.error('An error occurred:', err);
throw err; // If you want to stop the execution in case of an error
}
}