UNPKG

655 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.stat = exports.exists = exports.readFile = void 0;
7
8const fs = require("fs");
9
10const gensync = require("gensync");
11
12const readFile = gensync({
13 sync: fs.readFileSync,
14 errback: fs.readFile
15});
16exports.readFile = readFile;
17const exists = gensync({
18 sync(path) {
19 try {
20 fs.accessSync(path);
21 return true;
22 } catch (_unused) {
23 return false;
24 }
25 },
26
27 errback: (path, cb) => fs.access(path, undefined, err => cb(null, !err))
28});
29exports.exists = exists;
30const stat = gensync({
31 sync: fs.statSync,
32 errback: fs.stat
33});
34exports.stat = stat;
\No newline at end of file