const fsPromises = require('fs').promises // For ES syntax: import { promises as fsPromises } from 'fs' const directory = 'your/directory/path/here' await fsPromises.rmdir(directory, { recursive: true })