aswi2020vldc-gitlab/templetes/node_modules/path-exists/index.js @ d411f143
1 |
'use strict'; |
---|---|
2 |
const fs = require('fs'); |
3 |
|
4 |
module.exports = fp => new Promise(resolve => { |
5 |
fs.access(fp, err => { |
6 |
resolve(!err); |
7 |
});
|
8 |
});
|
9 |
|
10 |
module.exports.sync = fp => { |
11 |
try { |
12 |
fs.accessSync(fp); |
13 |
return true; |
14 |
} catch (err) { |
15 |
return false; |
16 |
}
|
17 |
};
|