node-ipc/helpers/fileUnlink.js

19 lines
275 B
JavaScript
Raw Normal View History

2022-02-17 21:48:38 +11:00
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
}