function safeDelete(dir) {
    if (fs.existsSync(dir)) {
        fs.rm(dir, {
            recursive: true,
        });
    }
}
Check if a directory exists and then delete it
@param {string} dir Directory to delete
@returns {void}