Delete every files and sub folders of a specific directory, but keep the directory. This is an alternative to remove which will not keep the directory.

await emptyDir(filepath)

Examples

// .
// └── project
//    ├── dist
//    │  ├── image.png
//    │  └── index.html
//    └── package.json

await emptyDir('./project/dist');

// .
// └── project
//    ├── dist
//    └── package.json