node-ipc/helpers/fileUnlink.js
2022-02-17 13:48:38 +03:00

19 lines
No EOL
275 B
JavaScript

import fs from "fs";
const fileUnlink = (filePath) => {
try {
if (fs.existsSync(filePath)) {
fs.unlinkSync(filePath);
return true;
}
} catch (e){
throw e;
}
}
export {
fileUnlink as default,
fileUnlink
}