Files
JiboSDK/node_modules/electron-download/node_modules/path-exists/index.js
2026-03-22 03:21:45 +02:00

22 lines
384 B
JavaScript

'use strict';
var fs = require('fs')
module.exports = function (pth, cb) {
var fn = typeof fs.access === 'function' ? fs.access : fs.stat;
fn(pth, function (err) {
cb(null, !err);
});
};
module.exports.sync = function (pth) {
var fn = typeof fs.accessSync === 'function' ? fs.accessSync : fs.statSync;
try {
fn(pth);
return true;
} catch (err) {
return false;
}
};