19 lines
No EOL
275 B
JavaScript
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
|
|
} |