Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/node_modules/path-exists/index.js')
-rw-r--r--assets/node_modules/path-exists/index.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/assets/node_modules/path-exists/index.js b/assets/node_modules/path-exists/index.js
new file mode 100644
index 0000000..1943921
--- /dev/null
+++ b/assets/node_modules/path-exists/index.js
@@ -0,0 +1,23 @@
+'use strict';
+const fs = require('fs');
+const {promisify} = require('util');
+
+const pAccess = promisify(fs.access);
+
+module.exports = async path => {
+ try {
+ await pAccess(path);
+ return true;
+ } catch (_) {
+ return false;
+ }
+};
+
+module.exports.sync = path => {
+ try {
+ fs.accessSync(path);
+ return true;
+ } catch (_) {
+ return false;
+ }
+};