summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/path-exists/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/path-exists/index.js')
-rw-r--r--deps/npm/node_modules/path-exists/index.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/deps/npm/node_modules/path-exists/index.js b/deps/npm/node_modules/path-exists/index.js
new file mode 100644
index 0000000000..16ae60acb1
--- /dev/null
+++ b/deps/npm/node_modules/path-exists/index.js
@@ -0,0 +1,17 @@
+'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;
+ }
+};