Open Pomax opened 2 hours ago
fs.exists
is deprecated in Node.js, so I don't see a reason for adding this.
You can create this function very easy if you need it:
async function exists(path) {
try {
await fs.stat(path);
return true;
} catch(e) {
return false;
}
}
or
function exists(path) {
return fs.stat(path)
.then(() => true)
.catch(() => false);
}
no need for dangling let.
It looks like the fairly critical
fs.exists
is missing from the set of available functions, which makes otherwise "simple if check" code a "try/catch with danglinglet
variables" mess. Could.exists
be added?