@gjsify/fs 0.3.16 → 0.3.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,163 +1 @@
1
- import { normalizePath } from "./utils.js";
2
- import GLib from "@girs/glib-2.0";
3
- import Gio from "@girs/gio-2.0";
4
- import { EventEmitter } from "node:events";
5
-
6
- //#region src/fs-watcher.ts
7
- const privates = new WeakMap();
8
- var FSWatcher = class extends EventEmitter {
9
- constructor(filename, options, listener) {
10
- super();
11
- if (!options || typeof options !== "object") options = { persistent: true };
12
- const persistent = options.persistent !== false;
13
- const cancellable = Gio.Cancellable.new();
14
- const pathStr = normalizePath(filename);
15
- const file = Gio.File.new_for_path(pathStr);
16
- const watcher = file.monitor(Gio.FileMonitorFlags.NONE, cancellable);
17
- watcher.connect("changed", changed.bind(this));
18
- let sourceId = null;
19
- if (persistent) {
20
- sourceId = GLib.timeout_add(GLib.PRIORITY_LOW, 2147483647, () => GLib.SOURCE_CONTINUE);
21
- }
22
- privates.set(this, {
23
- persistent,
24
- cancellable,
25
- sourceId,
26
- watcher
27
- });
28
- if (listener) this.on("change", listener);
29
- }
30
- close() {
31
- const priv = privates.get(this);
32
- if (!priv.cancellable.is_cancelled()) {
33
- priv.cancellable.cancel();
34
- if (priv.sourceId !== null) {
35
- GLib.source_remove(priv.sourceId);
36
- priv.sourceId = null;
37
- }
38
- }
39
- }
40
- /**
41
- * When called, requests that the Node.js event loop not exit so long as the
42
- * FSWatcher is active. Calling ref() multiple times has no effect.
43
- */
44
- ref() {
45
- const priv = privates.get(this);
46
- if (!priv.persistent && !priv.cancellable.is_cancelled()) {
47
- priv.persistent = true;
48
- priv.sourceId = GLib.timeout_add(GLib.PRIORITY_LOW, 2147483647, () => GLib.SOURCE_CONTINUE);
49
- }
50
- return this;
51
- }
52
- /**
53
- * When called, the active FSWatcher will not require the Node.js event loop
54
- * to remain active. Calling unref() multiple times has no effect.
55
- */
56
- unref() {
57
- const priv = privates.get(this);
58
- if (priv.persistent) {
59
- priv.persistent = false;
60
- if (priv.sourceId !== null) {
61
- GLib.source_remove(priv.sourceId);
62
- priv.sourceId = null;
63
- }
64
- }
65
- return this;
66
- }
67
- };
68
- ;
69
- function changed(watcher, file, otherFile, eventType) {
70
- switch (eventType) {
71
- case Gio.FileMonitorEvent.CHANGES_DONE_HINT:
72
- this.emit("change", "change", file.get_basename());
73
- break;
74
- case Gio.FileMonitorEvent.DELETED:
75
- case Gio.FileMonitorEvent.CREATED:
76
- case Gio.FileMonitorEvent.RENAMED:
77
- case Gio.FileMonitorEvent.MOVED_IN:
78
- case Gio.FileMonitorEvent.MOVED_OUT:
79
- this.emit("rename", "rename", file.get_basename());
80
- break;
81
- }
82
- }
83
- function gioEventToNodeType(eventType) {
84
- switch (eventType) {
85
- case Gio.FileMonitorEvent.CHANGES_DONE_HINT: return "change";
86
- case Gio.FileMonitorEvent.DELETED:
87
- case Gio.FileMonitorEvent.CREATED:
88
- case Gio.FileMonitorEvent.RENAMED:
89
- case Gio.FileMonitorEvent.MOVED_IN:
90
- case Gio.FileMonitorEvent.MOVED_OUT: return "rename";
91
- default: return null;
92
- }
93
- }
94
- async function* watchAsync(filename, options) {
95
- const signal = options?.signal;
96
- if (signal?.aborted) return;
97
- const pathStr = normalizePath(filename);
98
- const file = Gio.File.new_for_path(pathStr);
99
- const cancellable = Gio.Cancellable.new();
100
- let watcher;
101
- try {
102
- watcher = file.monitor(Gio.FileMonitorFlags.NONE, cancellable);
103
- } catch {
104
- return;
105
- }
106
- const eventQueue = [];
107
- const waiterQueue = [];
108
- let finished = false;
109
- function enqueue(event) {
110
- if (finished) return;
111
- if (waiterQueue.length > 0) {
112
- waiterQueue.shift().resolve({
113
- value: event,
114
- done: false
115
- });
116
- } else {
117
- eventQueue.push(event);
118
- }
119
- }
120
- function terminate() {
121
- if (finished) return;
122
- finished = true;
123
- if (!cancellable.is_cancelled()) cancellable.cancel();
124
- while (waiterQueue.length > 0) {
125
- waiterQueue.shift().resolve({
126
- value: undefined,
127
- done: true
128
- });
129
- }
130
- }
131
- const signalId = watcher.connect("changed", (_mon, changedFile, _otherFile, eventType) => {
132
- const type = gioEventToNodeType(eventType);
133
- if (type === null) return;
134
- enqueue({
135
- eventType: type,
136
- filename: changedFile?.get_basename() ?? null
137
- });
138
- });
139
- const abortHandler = () => terminate();
140
- signal?.addEventListener("abort", abortHandler);
141
- try {
142
- while (!finished) {
143
- if (eventQueue.length > 0) {
144
- yield eventQueue.shift();
145
- continue;
146
- }
147
- const result = await new Promise((resolve) => {
148
- waiterQueue.push({ resolve });
149
- });
150
- if (result.done) break;
151
- yield result.value;
152
- }
153
- } finally {
154
- signal?.removeEventListener("abort", abortHandler);
155
- try {
156
- watcher.disconnect(signalId);
157
- } catch {}
158
- if (!cancellable.is_cancelled()) cancellable.cancel();
159
- }
160
- }
161
-
162
- //#endregion
163
- export { FSWatcher, FSWatcher as default, watchAsync };
1
+ import{normalizePath as e}from"./utils.js";import t from"@girs/glib-2.0";import n from"@girs/gio-2.0";import{EventEmitter as r}from"node:events";const i=new WeakMap;var a=class extends r{constructor(r,a,s){super(),(!a||typeof a!=`object`)&&(a={persistent:!0});let c=a.persistent!==!1,l=n.Cancellable.new(),u=e(r),d=n.File.new_for_path(u).monitor(n.FileMonitorFlags.NONE,l);d.connect(`changed`,o.bind(this));let f=null;c&&(f=t.timeout_add(t.PRIORITY_LOW,2147483647,()=>t.SOURCE_CONTINUE)),i.set(this,{persistent:c,cancellable:l,sourceId:f,watcher:d}),s&&this.on(`change`,s)}close(){let e=i.get(this);e.cancellable.is_cancelled()||(e.cancellable.cancel(),e.sourceId!==null&&(t.source_remove(e.sourceId),e.sourceId=null))}ref(){let e=i.get(this);return!e.persistent&&!e.cancellable.is_cancelled()&&(e.persistent=!0,e.sourceId=t.timeout_add(t.PRIORITY_LOW,2147483647,()=>t.SOURCE_CONTINUE)),this}unref(){let e=i.get(this);return e.persistent&&(e.persistent=!1,e.sourceId!==null&&(t.source_remove(e.sourceId),e.sourceId=null)),this}};function o(e,t,r,i){switch(i){case n.FileMonitorEvent.CHANGES_DONE_HINT:this.emit(`change`,`change`,t.get_basename());break;case n.FileMonitorEvent.DELETED:case n.FileMonitorEvent.CREATED:case n.FileMonitorEvent.RENAMED:case n.FileMonitorEvent.MOVED_IN:case n.FileMonitorEvent.MOVED_OUT:this.emit(`rename`,`rename`,t.get_basename());break}}function s(e){switch(e){case n.FileMonitorEvent.CHANGES_DONE_HINT:return`change`;case n.FileMonitorEvent.DELETED:case n.FileMonitorEvent.CREATED:case n.FileMonitorEvent.RENAMED:case n.FileMonitorEvent.MOVED_IN:case n.FileMonitorEvent.MOVED_OUT:return`rename`;default:return null}}async function*c(t,r){let i=r?.signal;if(i?.aborted)return;let a=e(t),o=n.File.new_for_path(a),c=n.Cancellable.new(),l;try{l=o.monitor(n.FileMonitorFlags.NONE,c)}catch{return}let u=[],d=[],f=!1;function p(e){f||(d.length>0?d.shift().resolve({value:e,done:!1}):u.push(e))}function m(){if(!f)for(f=!0,c.is_cancelled()||c.cancel();d.length>0;)d.shift().resolve({value:void 0,done:!0})}let h=l.connect(`changed`,(e,t,n,r)=>{let i=s(r);i!==null&&p({eventType:i,filename:t?.get_basename()??null})}),g=()=>m();i?.addEventListener(`abort`,g);try{for(;!f;){if(u.length>0){yield u.shift();continue}let e=await new Promise(e=>{d.push({resolve:e})});if(e.done)break;yield e.value}}finally{i?.removeEventListener(`abort`,g);try{l.disconnect(h)}catch{}c.is_cancelled()||c.cancel()}}export{a as FSWatcher,a as default,c as watchAsync};
package/lib/esm/glob.js CHANGED
@@ -1,163 +1 @@
1
- import { normalizePath } from "./utils.js";
2
- import { readdirSync } from "./sync.js";
3
-
4
- //#region src/glob.ts
5
- /** Convert a single glob segment (no `/`) to a regex source string */
6
- function segmentToRegexSrc(seg) {
7
- const extglob = /^([!*+?@])\((.+)\)$/.exec(seg);
8
- if (extglob) {
9
- const [, type, inner] = extglob;
10
- const parts = inner.split("|").map((p) => segmentToRegexSrc(p));
11
- const group = "(?:" + parts.join("|") + ")";
12
- switch (type) {
13
- case "!": return "(?!(?:" + parts.join("|") + "))[^/]*";
14
- case "*": return group + "*";
15
- case "+": return group + "+";
16
- case "?": return group + "?";
17
- case "@": return group;
18
- }
19
- }
20
- let result = "";
21
- let i = 0;
22
- while (i < seg.length) {
23
- const c = seg[i];
24
- if (c === "*") {
25
- result += "[^/]*";
26
- i++;
27
- continue;
28
- }
29
- if (c === "?") {
30
- result += "[^/]";
31
- i++;
32
- continue;
33
- }
34
- if (c === "[") {
35
- const end = seg.indexOf("]", i + 1);
36
- if (end === -1) {
37
- result += "\\[";
38
- i++;
39
- continue;
40
- }
41
- result += seg.slice(i, end + 1);
42
- i = end + 1;
43
- continue;
44
- }
45
- if (c === "{") {
46
- const end = seg.indexOf("}", i + 1);
47
- if (end === -1) {
48
- result += "\\{";
49
- i++;
50
- continue;
51
- }
52
- const alts = seg.slice(i + 1, end).split(",").map((a) => segmentToRegexSrc(a.trim()));
53
- result += "(?:" + alts.join("|") + ")";
54
- i = end + 1;
55
- continue;
56
- }
57
- if (".+^$|()[]{}".includes(c)) {
58
- result += "\\" + c;
59
- } else {
60
- result += c;
61
- }
62
- i++;
63
- }
64
- return result;
65
- }
66
- /**
67
- * Convert a glob pattern to a RegExp that matches relative POSIX paths.
68
- */
69
- function globToRegex(pattern) {
70
- pattern = pattern.replace(/\/+/g, "/").replace(/^\.\//, "");
71
- const segments = pattern.split("/");
72
- const parts = [];
73
- for (let si = 0; si < segments.length; si++) {
74
- const seg = segments[si];
75
- const isLast = si === segments.length - 1;
76
- if (seg === "**") {
77
- if (isLast) {
78
- if (parts.length > 0 && parts[parts.length - 1] === "/") {
79
- parts.pop();
80
- parts.push("(?:/.+)?");
81
- } else {
82
- parts.push("(?:.+)?");
83
- }
84
- } else {
85
- parts.push("(?:[^/]+/)*");
86
- }
87
- } else {
88
- parts.push(segmentToRegexSrc(seg));
89
- if (!isLast) parts.push("/");
90
- }
91
- }
92
- return new RegExp("^(?:" + parts.join("") + ")$");
93
- }
94
- function buildExcludePredicate(exclude) {
95
- if (!exclude) return null;
96
- if (typeof exclude === "function") return exclude;
97
- const patterns = Array.isArray(exclude) ? exclude : [exclude];
98
- const regexes = patterns.map((p) => globToRegex(p));
99
- return (path) => regexes.some((rx) => rx.test(path));
100
- }
101
- function matchAll(pattern, cwd, exclude) {
102
- const regex = globToRegex(pattern);
103
- const isExcluded = buildExcludePredicate(exclude);
104
- let allEntries;
105
- try {
106
- allEntries = readdirSync(cwd, { recursive: true });
107
- } catch {
108
- return [];
109
- }
110
- const candidates = [".", ...allEntries];
111
- const results = [];
112
- for (const entry of candidates) {
113
- const normalized = entry.replace(/\\/g, "/");
114
- if (!regex.test(normalized)) continue;
115
- if (isExcluded && isExcluded(normalized)) continue;
116
- results.push(entry);
117
- }
118
- return results;
119
- }
120
- function globSync(pattern, options) {
121
- const patterns = Array.isArray(pattern) ? pattern : [pattern];
122
- const cwd = options?.cwd ? normalizePath(options.cwd) : globalThis.process?.cwd?.() ?? "/";
123
- const exclude = options?.exclude;
124
- const seen = new Set();
125
- const results = [];
126
- for (const p of patterns) {
127
- for (const match of matchAll(p, cwd, exclude)) {
128
- if (!seen.has(match)) {
129
- seen.add(match);
130
- results.push(match);
131
- }
132
- }
133
- }
134
- return results;
135
- }
136
- function glob(pattern, options, callback) {
137
- let opts;
138
- let cb;
139
- if (typeof options === "function") {
140
- cb = options;
141
- opts = {};
142
- } else {
143
- cb = callback;
144
- opts = options || {};
145
- }
146
- Promise.resolve().then(() => {
147
- try {
148
- const matches = globSync(pattern, opts);
149
- cb(null, matches);
150
- } catch (err) {
151
- cb(err, []);
152
- }
153
- });
154
- }
155
- async function* globAsync(pattern, options) {
156
- const matches = globSync(pattern, options);
157
- for (const m of matches) {
158
- yield m;
159
- }
160
- }
161
-
162
- //#endregion
163
- export { glob, globAsync, globSync };
1
+ import{normalizePath as e}from"./utils.js";import{readdirSync as t}from"./sync.js";function n(e){let t=/^([!*+?@])\((.+)\)$/.exec(e);if(t){let[,e,r]=t,i=r.split(`|`).map(e=>n(e)),a=`(?:`+i.join(`|`)+`)`;switch(e){case`!`:return`(?!(?:`+i.join(`|`)+`))[^/]*`;case`*`:return a+`*`;case`+`:return a+`+`;case`?`:return a+`?`;case`@`:return a}}let r=``,i=0;for(;i<e.length;){let t=e[i];if(t===`*`){r+=`[^/]*`,i++;continue}if(t===`?`){r+=`[^/]`,i++;continue}if(t===`[`){let t=e.indexOf(`]`,i+1);if(t===-1){r+=`\\[`,i++;continue}r+=e.slice(i,t+1),i=t+1;continue}if(t===`{`){let t=e.indexOf(`}`,i+1);if(t===-1){r+=`\\{`,i++;continue}let a=e.slice(i+1,t).split(`,`).map(e=>n(e.trim()));r+=`(?:`+a.join(`|`)+`)`,i=t+1;continue}`.+^$|()[]{}`.includes(t)?r+=`\\`+t:r+=t,i++}return r}function r(e){e=e.replace(/\/+/g,`/`).replace(/^\.\//,``);let t=e.split(`/`),r=[];for(let e=0;e<t.length;e++){let i=t[e],a=e===t.length-1;i===`**`?a?r.length>0&&r[r.length-1]===`/`?(r.pop(),r.push(`(?:/.+)?`)):r.push(`(?:.+)?`):r.push(`(?:[^/]+/)*`):(r.push(n(i)),a||r.push(`/`))}return RegExp(`^(?:`+r.join(``)+`)$`)}function i(e){if(!e)return null;if(typeof e==`function`)return e;let t=(Array.isArray(e)?e:[e]).map(e=>r(e));return e=>t.some(t=>t.test(e))}function a(e,n,a){let o=r(e),s=i(a),c;try{c=t(n,{recursive:!0})}catch{return[]}let l=[`.`,...c],u=[];for(let e of l){let t=e.replace(/\\/g,`/`);o.test(t)&&(s&&s(t)||u.push(e))}return u}function o(t,n){let r=Array.isArray(t)?t:[t],i=n?.cwd?e(n.cwd):globalThis.process?.cwd?.()??`/`,o=n?.exclude,s=new Set,c=[];for(let e of r)for(let t of a(e,i,o))s.has(t)||(s.add(t),c.push(t));return c}function s(e,t,n){let r,i;typeof t==`function`?(i=t,r={}):(i=n,r=t||{}),Promise.resolve().then(()=>{try{let t=o(e,r);i(null,t)}catch(e){i(e,[])}})}async function*c(e,t){let n=o(e,t);for(let e of n)yield e}export{s as glob,c as globAsync,o as globSync};
package/lib/esm/index.js CHANGED
@@ -1,163 +1 @@
1
- import { FSWatcher } from "./fs-watcher.js";
2
- import { ReadStream, createReadStream } from "./read-stream.js";
3
- import { WriteStream, createWriteStream } from "./write-stream.js";
4
- import { Dirent } from "./dirent.js";
5
- import { BigIntStats, Stats } from "./stats.js";
6
- import { accessSync, appendFileSync, chmodSync, chownSync, copyFileSync, existsSync, linkSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, rmdirSync, statSync, symlinkSync, truncateSync, unlinkSync, watch, writeFileSync } from "./sync.js";
7
- import { cp, cpSync } from "./cp.js";
8
- import { Dir, opendir, opendirSync } from "./dir.js";
9
- import { glob, globSync } from "./glob.js";
10
- import { statfs, statfsSync } from "./statfs.js";
11
- import { lchmod, lchmodSync, lchown, lchownSync, lutimes, lutimesSync, utimes, utimesSync } from "./utimes.js";
12
- import { closeSync, exists, fchmod, fchmodSync, fchown, fchownSync, fdatasync, fdatasyncSync, fstat, fstatSync, fsync, fsyncSync, ftruncate, ftruncateSync, futimes, futimesSync, openAsBlob, readSync, readv, readvSync, writeSync, writev, writevSync } from "./fd-ops.js";
13
- import { promises_exports } from "./promises.js";
14
- import { access, appendFile, chmod, chown, close, copyFile, link, lstat, mkdir, open, read, readFile, readdir, readlink, realpath, rename, rm, rmdir, stat, symlink, truncate, unlink, write, writeFile } from "./callback.js";
15
- import { StatWatcher, unwatchFile, watchFile } from "./stat-watcher.js";
16
-
17
- //#region src/index.ts
18
- const constants = {
19
- F_OK: 0,
20
- R_OK: 4,
21
- W_OK: 2,
22
- X_OK: 1,
23
- COPYFILE_EXCL: 1,
24
- COPYFILE_FICLONE: 2,
25
- COPYFILE_FICLONE_FORCE: 4,
26
- O_RDONLY: 0,
27
- O_WRONLY: 1,
28
- O_RDWR: 2,
29
- O_CREAT: 64,
30
- O_EXCL: 128,
31
- O_TRUNC: 512,
32
- O_APPEND: 1024,
33
- O_SYNC: 1052672,
34
- O_NONBLOCK: 2048,
35
- O_DIRECTORY: 65536,
36
- O_NOFOLLOW: 131072,
37
- S_IFMT: 61440,
38
- S_IFREG: 32768,
39
- S_IFDIR: 16384,
40
- S_IFCHR: 8192,
41
- S_IFBLK: 24576,
42
- S_IFIFO: 4096,
43
- S_IFLNK: 40960,
44
- S_IFSOCK: 49152,
45
- S_IRWXU: 448,
46
- S_IRUSR: 256,
47
- S_IWUSR: 128,
48
- S_IXUSR: 64,
49
- S_IRWXG: 56,
50
- S_IRGRP: 32,
51
- S_IWGRP: 16,
52
- S_IXGRP: 8,
53
- S_IRWXO: 7,
54
- S_IROTH: 4,
55
- S_IWOTH: 2,
56
- S_IXOTH: 1
57
- };
58
- var src_default = {
59
- FSWatcher,
60
- StatWatcher,
61
- Stats,
62
- BigIntStats,
63
- Dirent,
64
- Dir,
65
- constants,
66
- existsSync,
67
- readdirSync,
68
- readFileSync,
69
- writeFileSync,
70
- mkdirSync,
71
- rmdirSync,
72
- unlinkSync,
73
- mkdtempSync,
74
- rmSync,
75
- statSync,
76
- openSync,
77
- realpathSync,
78
- symlinkSync,
79
- lstatSync,
80
- renameSync,
81
- copyFileSync,
82
- accessSync,
83
- appendFileSync,
84
- readlinkSync,
85
- linkSync,
86
- truncateSync,
87
- chmodSync,
88
- chownSync,
89
- cpSync,
90
- opendirSync,
91
- globSync,
92
- glob,
93
- watch,
94
- watchFile,
95
- unwatchFile,
96
- statfsSync,
97
- statfs,
98
- utimesSync,
99
- utimes,
100
- lutimesSync,
101
- lutimes,
102
- lchownSync,
103
- lchown,
104
- lchmodSync,
105
- lchmod,
106
- fstatSync,
107
- fstat,
108
- ftruncateSync,
109
- ftruncate,
110
- fdatasyncSync,
111
- fdatasync,
112
- fsyncSync,
113
- fsync,
114
- fchmodSync,
115
- fchmod,
116
- fchownSync,
117
- fchown,
118
- futimesSync,
119
- futimes,
120
- closeSync,
121
- readSync,
122
- writeSync,
123
- readvSync,
124
- readv,
125
- writevSync,
126
- writev,
127
- exists,
128
- openAsBlob,
129
- createReadStream,
130
- ReadStream,
131
- createWriteStream,
132
- WriteStream,
133
- promises: promises_exports,
134
- open,
135
- close,
136
- read,
137
- write,
138
- rm,
139
- realpath,
140
- readdir,
141
- symlink,
142
- lstat,
143
- stat,
144
- rename,
145
- copyFile,
146
- cp,
147
- access,
148
- appendFile,
149
- readlink,
150
- truncate,
151
- chmod,
152
- chown,
153
- mkdir,
154
- rmdir,
155
- readFile,
156
- writeFile,
157
- unlink,
158
- link,
159
- opendir
160
- };
161
-
162
- //#endregion
163
- export { BigIntStats, Dir, Dirent, FSWatcher, ReadStream, StatWatcher, Stats, WriteStream, access, accessSync, appendFile, appendFileSync, chmod, chmodSync, chown, chownSync, close, closeSync, constants, copyFile, copyFileSync, cp, cpSync, createReadStream, createWriteStream, src_default as default, exists, existsSync, fchmod, fchmodSync, fchown, fchownSync, fdatasync, fdatasyncSync, fstat, fstatSync, fsync, fsyncSync, ftruncate, ftruncateSync, futimes, futimesSync, glob, globSync, lchmod, lchmodSync, lchown, lchownSync, link, linkSync, lstat, lstatSync, lutimes, lutimesSync, mkdir, mkdirSync, mkdtempSync, open, openAsBlob, openSync, opendir, opendirSync, promises_exports as promises, read, readFile, readFileSync, readSync, readdir, readdirSync, readlink, readlinkSync, readv, readvSync, realpath, realpathSync, rename, renameSync, rm, rmSync, rmdir, rmdirSync, stat, statSync, statfs, statfsSync, symlink, symlinkSync, truncate, truncateSync, unlink, unlinkSync, unwatchFile, utimes, utimesSync, watch, watchFile, write, writeFile, writeFileSync, writeSync, writev, writevSync };
1
+ import{FSWatcher as e}from"./fs-watcher.js";import{ReadStream as t,createReadStream as n}from"./read-stream.js";import{WriteStream as r,createWriteStream as i}from"./write-stream.js";import{Dirent as a}from"./dirent.js";import{BigIntStats as o,Stats as s}from"./stats.js";import{accessSync as c,appendFileSync as l,chmodSync as u,chownSync as d,copyFileSync as f,existsSync as p,linkSync as m,lstatSync as h,mkdirSync as g,mkdtempSync as _,openSync as v,readFileSync as y,readdirSync as b,readlinkSync as x,realpathSync as S,renameSync as C,rmSync as w,rmdirSync as T,statSync as E,symlinkSync as D,truncateSync as O,unlinkSync as k,watch as A,writeFileSync as j}from"./sync.js";import{cp as M,cpSync as N}from"./cp.js";import{Dir as P,opendir as F,opendirSync as I}from"./dir.js";import{glob as L,globSync as R}from"./glob.js";import{statfs as z,statfsSync as B}from"./statfs.js";import{lchmod as V,lchmodSync as H,lchown as U,lchownSync as W,lutimes as G,lutimesSync as K,utimes as q,utimesSync as J}from"./utimes.js";import{closeSync as Y,exists as X,fchmod as Z,fchmodSync as Q,fchown as $,fchownSync as ee,fdatasync as te,fdatasyncSync as ne,fstat as re,fstatSync as ie,fsync as ae,fsyncSync as oe,ftruncate as se,ftruncateSync as ce,futimes as le,futimesSync as ue,openAsBlob as de,readSync as fe,readv as pe,readvSync as me,writeSync as he,writev as ge,writevSync as _e}from"./fd-ops.js";import{promises_exports as ve}from"./promises.js";import{access as ye,appendFile as be,chmod as xe,chown as Se,close as Ce,copyFile as we,link as Te,lstat as Ee,mkdir as De,open as Oe,read as ke,readFile as Ae,readdir as je,readlink as Me,realpath as Ne,rename as Pe,rm as Fe,rmdir as Ie,stat as Le,symlink as Re,truncate as ze,unlink as Be,write as Ve,writeFile as He}from"./callback.js";import{StatWatcher as Ue,unwatchFile as We,watchFile as Ge}from"./stat-watcher.js";const Ke={F_OK:0,R_OK:4,W_OK:2,X_OK:1,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4,O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_CREAT:64,O_EXCL:128,O_TRUNC:512,O_APPEND:1024,O_SYNC:1052672,O_NONBLOCK:2048,O_DIRECTORY:65536,O_NOFOLLOW:131072,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1};var qe={FSWatcher:e,StatWatcher:Ue,Stats:s,BigIntStats:o,Dirent:a,Dir:P,constants:Ke,existsSync:p,readdirSync:b,readFileSync:y,writeFileSync:j,mkdirSync:g,rmdirSync:T,unlinkSync:k,mkdtempSync:_,rmSync:w,statSync:E,openSync:v,realpathSync:S,symlinkSync:D,lstatSync:h,renameSync:C,copyFileSync:f,accessSync:c,appendFileSync:l,readlinkSync:x,linkSync:m,truncateSync:O,chmodSync:u,chownSync:d,cpSync:N,opendirSync:I,globSync:R,glob:L,watch:A,watchFile:Ge,unwatchFile:We,statfsSync:B,statfs:z,utimesSync:J,utimes:q,lutimesSync:K,lutimes:G,lchownSync:W,lchown:U,lchmodSync:H,lchmod:V,fstatSync:ie,fstat:re,ftruncateSync:ce,ftruncate:se,fdatasyncSync:ne,fdatasync:te,fsyncSync:oe,fsync:ae,fchmodSync:Q,fchmod:Z,fchownSync:ee,fchown:$,futimesSync:ue,futimes:le,closeSync:Y,readSync:fe,writeSync:he,readvSync:me,readv:pe,writevSync:_e,writev:ge,exists:X,openAsBlob:de,createReadStream:n,ReadStream:t,createWriteStream:i,WriteStream:r,promises:ve,open:Oe,close:Ce,read:ke,write:Ve,rm:Fe,realpath:Ne,readdir:je,symlink:Re,lstat:Ee,stat:Le,rename:Pe,copyFile:we,cp:M,access:ye,appendFile:be,readlink:Me,truncate:ze,chmod:xe,chown:Se,mkdir:De,rmdir:Ie,readFile:Ae,writeFile:He,unlink:Be,link:Te,opendir:F};export{o as BigIntStats,P as Dir,a as Dirent,e as FSWatcher,t as ReadStream,Ue as StatWatcher,s as Stats,r as WriteStream,ye as access,c as accessSync,be as appendFile,l as appendFileSync,xe as chmod,u as chmodSync,Se as chown,d as chownSync,Ce as close,Y as closeSync,Ke as constants,we as copyFile,f as copyFileSync,M as cp,N as cpSync,n as createReadStream,i as createWriteStream,qe as default,X as exists,p as existsSync,Z as fchmod,Q as fchmodSync,$ as fchown,ee as fchownSync,te as fdatasync,ne as fdatasyncSync,re as fstat,ie as fstatSync,ae as fsync,oe as fsyncSync,se as ftruncate,ce as ftruncateSync,le as futimes,ue as futimesSync,L as glob,R as globSync,V as lchmod,H as lchmodSync,U as lchown,W as lchownSync,Te as link,m as linkSync,Ee as lstat,h as lstatSync,G as lutimes,K as lutimesSync,De as mkdir,g as mkdirSync,_ as mkdtempSync,Oe as open,de as openAsBlob,v as openSync,F as opendir,I as opendirSync,ve as promises,ke as read,Ae as readFile,y as readFileSync,fe as readSync,je as readdir,b as readdirSync,Me as readlink,x as readlinkSync,pe as readv,me as readvSync,Ne as realpath,S as realpathSync,Pe as rename,C as renameSync,Fe as rm,w as rmSync,Ie as rmdir,T as rmdirSync,Le as stat,E as statSync,z as statfs,B as statfsSync,Re as symlink,D as symlinkSync,ze as truncate,O as truncateSync,Be as unlink,k as unlinkSync,We as unwatchFile,q as utimes,J as utimesSync,A as watch,Ge as watchFile,Ve as write,He as writeFile,j as writeFileSync,he as writeSync,ge as writev,_e as writevSync};