install-nix-action/node_modules/path-exists/index.js
Domen Kožar 08403cd828
v5
2019-11-13 17:14:48 +01:00

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;
}
};