You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
parttimejob/node_modules/path-exists/index.js

24 lines
347 B

4 weeks ago
'use strict';
const fs = require('fs');
const {promisify} = require('util');
const pAccess = promisify(fs.access);
module.exports = async path => {
try {
await pAccess(path);
return true;
} catch (_) {
return false;
}
};
module.exports.sync = path => {
try {
fs.accessSync(path);
return true;
} catch (_) {
return false;
}
};