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