import { readdir } from "fs/promises";
import path from "path";
import fs from "fs";

const emptyDir = async (destination: string) => {
    const files = await readdir(destination, { withFileTypes: true });
    for (const file of files) {
        const dir = path.join(destination, file.name);
        fs.unlink(dir, (err) => {
            if (err) throw err;
        });
    }
};

export default emptyDir;
