setup-php/node_modules/path-exists/index.js
Shivam Mathur 8f9786b73f init
2019-09-06 05:17:43 +05:30

18 lines
252 B
JavaScript

'use strict';
const fs = require('fs');
module.exports = fp => new Promise(resolve => {
fs.access(fp, err => {
resolve(!err);
});
});
module.exports.sync = fp => {
try {
fs.accessSync(fp);
return true;
} catch (err) {
return false;
}
};