source: trip-planner-front/node_modules/import-local/node_modules/path-exists/index.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 252 bytes
RevLine 
[6a3a178]1'use strict';
2const fs = require('fs');
3
4module.exports = fp => new Promise(resolve => {
5 fs.access(fp, err => {
6 resolve(!err);
7 });
8});
9
10module.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.