source:
trip-planner-front/node_modules/import-local/node_modules/path-exists/index.js
Last change on this file was 6a3a178, checked in by , 3 years ago | |
---|---|
|
|
File size: 252 bytes |
Line | |
---|---|
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 | }; |
Note:
See TracBrowser
for help on using the repository browser.