eaz-utils
Version:
A cleverly organized set of utilities to make JavaScript and TypeScript development easier.
20 lines (15 loc) • 357 B
JavaScript
const fs = require('fs');
const common = require("../../common");
function remove(path = "") {
const fullPath = common.prepareFullPath(path);
try {
fs.unlinkSync(fullPath);
}
catch (err) {
// ENOENT is when the file at the path does not exist
if (err.code === 'ENOENT') return false;
throw err;
}
return true;
}
module.exports = remove;