delete sync folder in node code example Example: delete dir nodejs fs.rmdirSync(dir, { recursive: true });