@gjsify/fs 0.0.1 → 0.0.3

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.
Files changed (80) hide show
  1. package/README.md +6 -8
  2. package/lib/cjs/callback.js +112 -0
  3. package/lib/cjs/dirent.js +98 -0
  4. package/lib/cjs/encoding.js +34 -0
  5. package/lib/cjs/file-handle.js +444 -0
  6. package/lib/cjs/fs-watcher.js +50 -0
  7. package/lib/cjs/index.js +95 -0
  8. package/lib/cjs/promises.js +160 -0
  9. package/lib/cjs/read-stream.js +78 -0
  10. package/lib/cjs/stats.js +45 -0
  11. package/lib/cjs/sync.js +126 -0
  12. package/lib/cjs/types/encoding-option.js +0 -0
  13. package/lib/cjs/types/file-read-options.js +0 -0
  14. package/lib/cjs/types/file-read-result.js +0 -0
  15. package/lib/cjs/types/flag-and-open-mode.js +0 -0
  16. package/lib/cjs/types/index.js +6 -0
  17. package/lib/cjs/types/open-flags.js +0 -0
  18. package/lib/cjs/types/read-options.js +0 -0
  19. package/lib/cjs/utils.js +18 -0
  20. package/lib/cjs/write-stream.js +116 -0
  21. package/lib/esm/callback.js +112 -0
  22. package/lib/esm/dirent.js +98 -0
  23. package/lib/esm/encoding.js +34 -0
  24. package/lib/esm/file-handle.js +444 -0
  25. package/lib/esm/fs-watcher.js +50 -0
  26. package/lib/esm/index.js +95 -0
  27. package/lib/esm/promises.js +160 -0
  28. package/lib/esm/read-stream.js +78 -0
  29. package/lib/esm/stats.js +45 -0
  30. package/lib/esm/sync.js +126 -0
  31. package/lib/esm/types/encoding-option.js +0 -0
  32. package/lib/esm/types/file-read-options.js +0 -0
  33. package/lib/esm/types/file-read-result.js +0 -0
  34. package/lib/esm/types/flag-and-open-mode.js +0 -0
  35. package/lib/esm/types/index.js +6 -0
  36. package/lib/esm/types/open-flags.js +0 -0
  37. package/lib/esm/types/read-options.js +0 -0
  38. package/lib/esm/utils.js +18 -0
  39. package/lib/esm/write-stream.js +116 -0
  40. package/package.json +52 -17
  41. package/src/callback.spec.ts +42 -0
  42. package/src/callback.ts +362 -0
  43. package/src/dirent.ts +117 -0
  44. package/src/encoding.ts +40 -0
  45. package/src/file-handle.spec.ts +34 -0
  46. package/src/file-handle.ts +606 -0
  47. package/{fs-watcher.js → src/fs-watcher.ts} +10 -9
  48. package/src/index.ts +95 -0
  49. package/src/promises.spec.ts +172 -0
  50. package/src/promises.ts +349 -0
  51. package/src/read-stream.ts +98 -0
  52. package/src/stat.spec.ts +79 -0
  53. package/src/stats.ts +106 -0
  54. package/src/symlink.spec.ts +38 -0
  55. package/src/sync.spec.ts +205 -0
  56. package/src/sync.ts +239 -0
  57. package/src/test.mts +11 -0
  58. package/src/types/encoding-option.ts +3 -0
  59. package/src/types/file-read-options.ts +15 -0
  60. package/src/types/file-read-result.ts +4 -0
  61. package/src/types/flag-and-open-mode.ts +6 -0
  62. package/src/types/index.ts +6 -0
  63. package/src/types/open-flags.ts +14 -0
  64. package/src/types/read-options.ts +9 -0
  65. package/src/utils.ts +19 -0
  66. package/src/write-stream.ts +143 -0
  67. package/test/file.txt +1 -0
  68. package/test/watch.js +1 -0
  69. package/test.gjs.js +35359 -0
  70. package/test.gjs.js.map +7 -0
  71. package/test.gjs.mjs +40570 -0
  72. package/test.gjs.mjs.meta.json +1 -0
  73. package/test.node.js +1479 -0
  74. package/test.node.js.map +7 -0
  75. package/test.node.mjs +710 -0
  76. package/tsconfig.json +18 -0
  77. package/tsconfig.types.json +8 -0
  78. package/index.js +0 -114
  79. package/test/index.js +0 -90
  80. package/test/resources/file.txt +0 -1
@@ -0,0 +1,444 @@
1
+ import { warnNotImplemented, notImplemented } from "@gjsify/utils";
2
+ import { ReadStream } from "./read-stream.js";
3
+ import { WriteStream } from "./write-stream.js";
4
+ import { Stats } from "./stats.js";
5
+ import { getEncodingFromOptions, encodeUint8Array } from "./encoding.js";
6
+ import GLib from "@girs/glib-2.0";
7
+ import { ReadableStream } from "stream/web";
8
+ import { Buffer } from "buffer";
9
+ class FileHandle {
10
+ constructor(options) {
11
+ this.options = options;
12
+ this.options.flags ||= "r";
13
+ this.options.mode ||= 438;
14
+ this._file = GLib.IOChannel.new_file(options.path.toString(), this.options.flags);
15
+ this.fd = this._file.unix_get_fd();
16
+ FileHandle.instances[this.fd] = this;
17
+ return FileHandle.getInstance(this.fd);
18
+ }
19
+ /** Not part of the default implementation, used internal by gjsify */
20
+ _file;
21
+ /** Not part of the default implementation, used internal by gjsify */
22
+ static instances = {};
23
+ /**
24
+ * The numeric file descriptor managed by the {FileHandle} object.
25
+ * @since v10.0.0
26
+ */
27
+ fd;
28
+ /** Not part of the default implementation, used internal by gjsify */
29
+ static getInstance(fd) {
30
+ const instance = FileHandle.instances[fd];
31
+ if (!instance) {
32
+ throw new Error("No instance found for fd!");
33
+ }
34
+ return FileHandle.instances[fd];
35
+ }
36
+ /**
37
+ * Alias of `filehandle.writeFile()`.
38
+ *
39
+ * When operating on file handles, the mode cannot be changed from what it was set
40
+ * to with `fsPromises.open()`. Therefore, this is equivalent to `filehandle.writeFile()`.
41
+ * @since v10.0.0
42
+ * @return Fulfills with `undefined` upon success.
43
+ */
44
+ async appendFile(data, options) {
45
+ const encoding = getEncodingFromOptions(options);
46
+ if (typeof data === "string") {
47
+ data = Buffer.from(data);
48
+ }
49
+ if (encoding)
50
+ this._file.set_encoding(encoding);
51
+ const [status, written] = this._file.write_chars(data, data.length);
52
+ if (status === GLib.IOStatus.ERROR) {
53
+ throw new Error("Error on append to file!");
54
+ }
55
+ }
56
+ /**
57
+ * Changes the ownership of the file. A wrapper for [`chown(2)`](http://man7.org/linux/man-pages/man2/chown.2.html).
58
+ * @since v10.0.0
59
+ * @param uid The file's new owner's user id.
60
+ * @param gid The file's new group's group id.
61
+ * @return Fulfills with `undefined` upon success.
62
+ */
63
+ async chown(uid, gid) {
64
+ warnNotImplemented("fs.FileHandle.chown");
65
+ }
66
+ /**
67
+ * Modifies the permissions on the file. See [`chmod(2)`](http://man7.org/linux/man-pages/man2/chmod.2.html).
68
+ * @since v10.0.0
69
+ * @param mode the file mode bit mask.
70
+ * @return Fulfills with `undefined` upon success.
71
+ */
72
+ async chmod(mode) {
73
+ warnNotImplemented("fs.FileHandle.chmod");
74
+ }
75
+ /**
76
+ * Unlike the 16 kb default `highWaterMark` for a `stream.Readable`, the stream
77
+ * returned by this method has a default `highWaterMark` of 64 kb.
78
+ *
79
+ * `options` can include `start` and `end` values to read a range of bytes from
80
+ * the file instead of the entire file. Both `start` and `end` are inclusive and
81
+ * start counting at 0, allowed values are in the
82
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. If `start` is
83
+ * omitted or `undefined`, `filehandle.createReadStream()` reads sequentially from
84
+ * the current file position. The `encoding` can be any one of those accepted by `Buffer`.
85
+ *
86
+ * If the `FileHandle` points to a character device that only supports blocking
87
+ * reads (such as keyboard or sound card), read operations do not finish until data
88
+ * is available. This can prevent the process from exiting and the stream from
89
+ * closing naturally.
90
+ *
91
+ * By default, the stream will emit a `'close'` event after it has been
92
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
93
+ *
94
+ * ```js
95
+ * import { open } from 'fs/promises';
96
+ *
97
+ * const fd = await open('/dev/input/event0');
98
+ * // Create a stream from some character device.
99
+ * const stream = fd.createReadStream();
100
+ * setTimeout(() => {
101
+ * stream.close(); // This may not close the stream.
102
+ * // Artificially marking end-of-stream, as if the underlying resource had
103
+ * // indicated end-of-file by itself, allows the stream to close.
104
+ * // This does not cancel pending read operations, and if there is such an
105
+ * // operation, the process may still not be able to exit successfully
106
+ * // until it finishes.
107
+ * stream.push(null);
108
+ * stream.read(0);
109
+ * }, 100);
110
+ * ```
111
+ *
112
+ * If `autoClose` is false, then the file descriptor won't be closed, even if
113
+ * there's an error. It is the application's responsibility to close it and make
114
+ * sure there's no file descriptor leak. If `autoClose` is set to true (default
115
+ * behavior), on `'error'` or `'end'` the file descriptor will be closed
116
+ * automatically.
117
+ *
118
+ * An example to read the last 10 bytes of a file which is 100 bytes long:
119
+ *
120
+ * ```js
121
+ * import { open } from 'fs/promises';
122
+ *
123
+ * const fd = await open('sample.txt');
124
+ * fd.createReadStream({ start: 90, end: 99 });
125
+ * ```
126
+ * @since v16.11.0
127
+ */
128
+ createReadStream(options) {
129
+ return new ReadStream(this.options.path, options);
130
+ }
131
+ /**
132
+ * `options` may also include a `start` option to allow writing data at some
133
+ * position past the beginning of the file, allowed values are in the
134
+ * \[0, [`Number.MAX_SAFE_INTEGER`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER)\] range. Modifying a file rather than
135
+ * replacing it may require the `flags` `open` option to be set to `r+` rather than
136
+ * the default `r`. The `encoding` can be any one of those accepted by `Buffer`.
137
+ *
138
+ * If `autoClose` is set to true (default behavior) on `'error'` or `'finish'`the file descriptor will be closed automatically. If `autoClose` is false,
139
+ * then the file descriptor won't be closed, even if there's an error.
140
+ * It is the application's responsibility to close it and make sure there's no
141
+ * file descriptor leak.
142
+ *
143
+ * By default, the stream will emit a `'close'` event after it has been
144
+ * destroyed. Set the `emitClose` option to `false` to change this behavior.
145
+ * @since v16.11.0
146
+ */
147
+ createWriteStream(options) {
148
+ return new WriteStream(this.options.path, options);
149
+ }
150
+ /**
151
+ * Forces all currently queued I/O operations associated with the file to the
152
+ * operating system's synchronized I/O completion state. Refer to the POSIX [`fdatasync(2)`](http://man7.org/linux/man-pages/man2/fdatasync.2.html) documentation for details.
153
+ *
154
+ * Unlike `filehandle.sync` this method does not flush modified metadata.
155
+ * @since v10.0.0
156
+ * @return Fulfills with `undefined` upon success.
157
+ */
158
+ async datasync() {
159
+ warnNotImplemented("fs.FileHandle.datasync");
160
+ }
161
+ /**
162
+ * Request that all data for the open file descriptor is flushed to the storage
163
+ * device. The specific implementation is operating system and device specific.
164
+ * Refer to the POSIX [`fsync(2)`](http://man7.org/linux/man-pages/man2/fsync.2.html) documentation for more detail.
165
+ * @since v10.0.0
166
+ * @return Fufills with `undefined` upon success.
167
+ */
168
+ async sync() {
169
+ warnNotImplemented("fs.FileHandle.sync");
170
+ }
171
+ async read(args) {
172
+ let buffer;
173
+ let offset;
174
+ let length;
175
+ let position;
176
+ if (typeof args[0] === "object") {
177
+ const options = args[0];
178
+ buffer = options.buffer;
179
+ offset = options.offset;
180
+ length = options.length;
181
+ position = options.position;
182
+ } else {
183
+ buffer = args[0];
184
+ offset = args[1];
185
+ length = args[2];
186
+ position = args[3];
187
+ }
188
+ if (offset) {
189
+ const status2 = this._file.seek_position(offset, GLib.SeekType.CUR);
190
+ if (status2 === GLib.IOStatus.ERROR) {
191
+ throw new Error("Error on set offset!");
192
+ }
193
+ }
194
+ if (length)
195
+ this._file.set_buffer_size(length);
196
+ if (position) {
197
+ const status2 = this._file.seek_position(position, GLib.SeekType.SET);
198
+ if (status2 === GLib.IOStatus.ERROR) {
199
+ throw new Error("Error on set position!");
200
+ }
201
+ }
202
+ const [status, buf, bytesRead] = this._file.read_chars();
203
+ if (status === GLib.IOStatus.ERROR) {
204
+ throw new Error("Error on read!");
205
+ }
206
+ buffer = buf;
207
+ return {
208
+ bytesRead,
209
+ buffer
210
+ };
211
+ }
212
+ /**
213
+ * Returns a `ReadableStream` that may be used to read the files data.
214
+ *
215
+ * An error will be thrown if this method is called more than once or is called after the `FileHandle` is closed
216
+ * or closing.
217
+ *
218
+ * ```js
219
+ * import { open } from 'fs/promises';
220
+ *
221
+ * const file = await open('./some/file/to/read');
222
+ *
223
+ * for await (const chunk of file.readableWebStream())
224
+ * console.log(chunk);
225
+ *
226
+ * await file.close();
227
+ * ```
228
+ *
229
+ * While the `ReadableStream` will read the file to completion, it will not close the `FileHandle` automatically. User code must still call the `fileHandle.close()` method.
230
+ *
231
+ * @since v17.0.0
232
+ * @experimental
233
+ */
234
+ readableWebStream() {
235
+ return new ReadableStream();
236
+ }
237
+ /**
238
+ * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
239
+ * The `FileHandle` must have been opened for reading.
240
+ * @param options An object that may contain an optional flag.
241
+ * If a flag is not provided, it defaults to `'r'`.
242
+ */
243
+ async readFile(options) {
244
+ const encoding = getEncodingFromOptions(options, "buffer");
245
+ if (encoding)
246
+ this._file.set_encoding(encoding);
247
+ const [status, buf] = this._file.read_to_end();
248
+ if (status === GLib.IOStatus.ERROR) {
249
+ throw new Error("Error on read from file!");
250
+ }
251
+ const res = encodeUint8Array(encoding, buf);
252
+ return res;
253
+ }
254
+ /**
255
+ * Convenience method to create a `readline` interface and stream over the file. For example:
256
+ *
257
+ * ```js
258
+ * import { open } from 'node:fs/promises';
259
+ *
260
+ * const file = await open('./some/file/to/read');
261
+ *
262
+ * for await (const line of file.readLines()) {
263
+ * console.log(line);
264
+ * }
265
+ * ```
266
+ *
267
+ * @since v18.11.0
268
+ * @param options See `filehandle.createReadStream()` for the options.
269
+ */
270
+ readLines(options) {
271
+ notImplemented("fs.FileHandle.readLines");
272
+ }
273
+ async stat(opts) {
274
+ warnNotImplemented("fs.FileHandle.stat");
275
+ return new Stats(this.options.path.toString());
276
+ }
277
+ /**
278
+ * Truncates the file.
279
+ *
280
+ * If the file was larger than `len` bytes, only the first `len` bytes will be
281
+ * retained in the file.
282
+ *
283
+ * The following example retains only the first four bytes of the file:
284
+ *
285
+ * ```js
286
+ * import { open } from 'fs/promises';
287
+ *
288
+ * let filehandle = null;
289
+ * try {
290
+ * filehandle = await open('temp.txt', 'r+');
291
+ * await filehandle.truncate(4);
292
+ * } finally {
293
+ * await filehandle?.close();
294
+ * }
295
+ * ```
296
+ *
297
+ * If the file previously was shorter than `len` bytes, it is extended, and the
298
+ * extended part is filled with null bytes (`'\0'`):
299
+ *
300
+ * If `len` is negative then `0` will be used.
301
+ * @since v10.0.0
302
+ * @param [len=0]
303
+ * @return Fulfills with `undefined` upon success.
304
+ */
305
+ async truncate(len) {
306
+ warnNotImplemented("fs.FileHandle.truncate");
307
+ }
308
+ /**
309
+ * Change the file system timestamps of the object referenced by the `FileHandle` then resolves the promise with no arguments upon success.
310
+ * @since v10.0.0
311
+ */
312
+ async utimes(atime, mtime) {
313
+ warnNotImplemented("fs.FileHandle.utimes");
314
+ }
315
+ /**
316
+ * Asynchronously writes data to a file, replacing the file if it already exists.`data` can be a string, a buffer, an
317
+ * [AsyncIterable](https://tc39.github.io/ecma262/#sec-asynciterable-interface) or
318
+ * [Iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol) object.
319
+ * The promise is resolved with no arguments upon success.
320
+ *
321
+ * If `options` is a string, then it specifies the `encoding`.
322
+ *
323
+ * The `FileHandle` has to support writing.
324
+ *
325
+ * It is unsafe to use `filehandle.writeFile()` multiple times on the same file
326
+ * without waiting for the promise to be resolved (or rejected).
327
+ *
328
+ * If one or more `filehandle.write()` calls are made on a file handle and then a`filehandle.writeFile()` call is made, the data will be written from the
329
+ * current position till the end of the file. It doesn't always write from the
330
+ * beginning of the file.
331
+ * @since v10.0.0
332
+ */
333
+ async writeFile(data, options) {
334
+ warnNotImplemented("fs.FileHandle.writeFile");
335
+ }
336
+ async write(data, ...args) {
337
+ let position = null;
338
+ let encoding = null;
339
+ let offset = null;
340
+ let length = null;
341
+ if (typeof data === "string") {
342
+ position = args[0];
343
+ encoding = args[1];
344
+ } else {
345
+ offset = args[0];
346
+ length = args[1];
347
+ position = args[2];
348
+ }
349
+ encoding = getEncodingFromOptions(encoding, typeof data === "string" ? "utf8" : null);
350
+ if (encoding) {
351
+ console.log("set_encoding", encoding, this._file.get_encoding(), typeof data);
352
+ this._file.set_encoding(encoding === "buffer" ? null : encoding);
353
+ }
354
+ if (offset) {
355
+ const status2 = this._file.seek_position(offset, GLib.SeekType.CUR);
356
+ if (status2 === GLib.IOStatus.ERROR) {
357
+ throw new Error("Error on set offset!");
358
+ }
359
+ }
360
+ if (length)
361
+ this._file.set_buffer_size(length);
362
+ if (position) {
363
+ const status2 = this._file.seek_position(position, GLib.SeekType.SET);
364
+ if (status2 === GLib.IOStatus.ERROR) {
365
+ throw new Error("Error on set position!");
366
+ }
367
+ }
368
+ let bytesWritten = 0;
369
+ let status;
370
+ if (typeof data === "string") {
371
+ status = this._file.write_unichar(data);
372
+ bytesWritten = data.length;
373
+ } else {
374
+ const [_status, _bytesWritten] = this._file.write_chars(data, length);
375
+ bytesWritten = _bytesWritten;
376
+ status = _status;
377
+ }
378
+ if (status === GLib.IOStatus.ERROR) {
379
+ throw new Error("Error on write to file!");
380
+ }
381
+ return {
382
+ bytesWritten,
383
+ buffer: data
384
+ };
385
+ }
386
+ /**
387
+ * Write an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s to the file.
388
+ *
389
+ * The promise is resolved with an object containing a two properties:
390
+ *
391
+ * It is unsafe to call `writev()` multiple times on the same file without waiting
392
+ * for the promise to be resolved (or rejected).
393
+ *
394
+ * On Linux, positional writes don't work when the file is opened in append mode.
395
+ * The kernel ignores the position argument and always appends the data to
396
+ * the end of the file.
397
+ * @since v12.9.0
398
+ * @param position The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current
399
+ * position.
400
+ */
401
+ async writev(buffers, position) {
402
+ warnNotImplemented("fs.FileHandle.writev");
403
+ return {
404
+ bytesWritten: 0,
405
+ buffers: []
406
+ };
407
+ }
408
+ /**
409
+ * Read from a file and write to an array of [ArrayBufferView](https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView) s
410
+ * @since v13.13.0, v12.17.0
411
+ * @param position The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.
412
+ * @return Fulfills upon success an object containing two properties:
413
+ */
414
+ async readv(buffers, position) {
415
+ warnNotImplemented("fs.FileHandle.readv");
416
+ return {
417
+ bytesRead: 0,
418
+ buffers: []
419
+ };
420
+ }
421
+ /**
422
+ * Closes the file handle after waiting for any pending operation on the handle to
423
+ * complete.
424
+ *
425
+ * ```js
426
+ * import { open } from 'fs/promises';
427
+ *
428
+ * let filehandle;
429
+ * try {
430
+ * filehandle = await open('thefile.txt', 'r');
431
+ * } finally {
432
+ * await filehandle?.close();
433
+ * }
434
+ * ```
435
+ * @since v10.0.0
436
+ * @return Fulfills with `undefined` upon success.
437
+ */
438
+ async close() {
439
+ this._file.close();
440
+ }
441
+ }
442
+ export {
443
+ FileHandle
444
+ };
@@ -0,0 +1,50 @@
1
+ import Gio from "@girs/gio-2.0";
2
+ import { EventEmitter } from "events";
3
+ const privates = /* @__PURE__ */ new WeakMap();
4
+ class FSWatcher extends EventEmitter {
5
+ constructor(filename, options, listener) {
6
+ super();
7
+ if (!options || typeof options !== "object")
8
+ options = { persistent: true };
9
+ const cancellable = Gio.Cancellable.new();
10
+ const file = Gio.File.new_for_path(filename);
11
+ const watcher = file.monitor(Gio.FileMonitorFlags.NONE, cancellable);
12
+ watcher.connect("changed", changed.bind(this));
13
+ privates.set(this, {
14
+ persistent: options.persistent,
15
+ cancellable,
16
+ // even if never used later on, the monitor needs to be
17
+ // attached to this instance or GJS reference counter
18
+ // will ignore it and no watch will ever happen
19
+ watcher
20
+ });
21
+ if (listener)
22
+ this.on("change", listener);
23
+ }
24
+ close() {
25
+ const { cancellable, persistent } = privates.get(this);
26
+ if (!cancellable.is_cancelled()) {
27
+ cancellable.cancel();
28
+ }
29
+ }
30
+ }
31
+ ;
32
+ function changed(watcher, file, otherFile, eventType) {
33
+ switch (eventType) {
34
+ case Gio.FileMonitorEvent.CHANGES_DONE_HINT:
35
+ this.emit("change", "change", file.get_basename());
36
+ break;
37
+ case Gio.FileMonitorEvent.DELETED:
38
+ case Gio.FileMonitorEvent.CREATED:
39
+ case Gio.FileMonitorEvent.RENAMED:
40
+ case Gio.FileMonitorEvent.MOVED_IN:
41
+ case Gio.FileMonitorEvent.MOVED_OUT:
42
+ this.emit("rename", "rename", file.get_basename());
43
+ break;
44
+ }
45
+ }
46
+ var fs_watcher_default = FSWatcher;
47
+ export {
48
+ FSWatcher,
49
+ fs_watcher_default as default
50
+ };
@@ -0,0 +1,95 @@
1
+ import {
2
+ existsSync,
3
+ readdirSync,
4
+ readFileSync,
5
+ writeFileSync,
6
+ mkdirSync,
7
+ rmdirSync,
8
+ unlinkSync,
9
+ watch,
10
+ mkdtempSync,
11
+ rmSync,
12
+ statSync,
13
+ openSync,
14
+ realpathSync,
15
+ symlinkSync,
16
+ lstatSync
17
+ } from "./sync.js";
18
+ import {
19
+ open,
20
+ close,
21
+ read,
22
+ write,
23
+ rm,
24
+ realpath,
25
+ readdir,
26
+ symlink,
27
+ lstat
28
+ } from "./callback.js";
29
+ import FSWatcher from "./fs-watcher.js";
30
+ import {
31
+ createReadStream,
32
+ ReadStream
33
+ } from "./read-stream.js";
34
+ import * as promises from "./promises.js";
35
+ var src_default = {
36
+ FSWatcher,
37
+ existsSync,
38
+ readdirSync,
39
+ readFileSync,
40
+ writeFileSync,
41
+ mkdirSync,
42
+ rmdirSync,
43
+ unlinkSync,
44
+ mkdtempSync,
45
+ rmSync,
46
+ statSync,
47
+ openSync,
48
+ realpathSync,
49
+ symlinkSync,
50
+ lstatSync,
51
+ watch,
52
+ createReadStream,
53
+ ReadStream,
54
+ promises,
55
+ open,
56
+ close,
57
+ read,
58
+ write,
59
+ rm,
60
+ realpath,
61
+ readdir,
62
+ symlink,
63
+ lstat
64
+ };
65
+ export {
66
+ FSWatcher,
67
+ ReadStream,
68
+ close,
69
+ createReadStream,
70
+ src_default as default,
71
+ existsSync,
72
+ lstat,
73
+ lstatSync,
74
+ mkdirSync,
75
+ mkdtempSync,
76
+ open,
77
+ openSync,
78
+ promises,
79
+ read,
80
+ readFileSync,
81
+ readdir,
82
+ readdirSync,
83
+ realpath,
84
+ realpathSync,
85
+ rm,
86
+ rmSync,
87
+ rmdirSync,
88
+ statSync,
89
+ symlink,
90
+ symlinkSync,
91
+ unlinkSync,
92
+ watch,
93
+ write,
94
+ writeFileSync
95
+ };