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