@statewalker/webrun-files 0.5.0 → 0.7.0

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 (42) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +93 -113
  3. package/dist/cjs/index.cjs +84 -526
  4. package/dist/esm/index.js +78 -517
  5. package/dist/file-utils.d.ts +47 -0
  6. package/dist/file-utils.d.ts.map +1 -0
  7. package/dist/index.d.ts +14 -8
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/{utils/path-utils.d.ts → path-utils.d.ts} +10 -1
  10. package/dist/path-utils.d.ts.map +1 -0
  11. package/dist/types.d.ts +90 -54
  12. package/dist/types.d.ts.map +1 -1
  13. package/package.json +4 -7
  14. package/src/file-utils.ts +106 -0
  15. package/src/index.ts +33 -27
  16. package/src/{utils/path-utils.ts → path-utils.ts} +16 -2
  17. package/src/types.ts +90 -53
  18. package/dist/files-api.d.ts +0 -44
  19. package/dist/files-api.d.ts.map +0 -1
  20. package/dist/impl/index.d.ts +0 -6
  21. package/dist/impl/index.d.ts.map +0 -1
  22. package/dist/impl/mem-files-api.d.ts +0 -13
  23. package/dist/impl/mem-files-api.d.ts.map +0 -1
  24. package/dist/impl/node-files-api.d.ts +0 -24
  25. package/dist/impl/node-files-api.d.ts.map +0 -1
  26. package/dist/utils/collect-stream.d.ts +0 -16
  27. package/dist/utils/collect-stream.d.ts.map +0 -1
  28. package/dist/utils/file-info-utils.d.ts +0 -10
  29. package/dist/utils/file-info-utils.d.ts.map +0 -1
  30. package/dist/utils/index.d.ts +0 -8
  31. package/dist/utils/index.d.ts.map +0 -1
  32. package/dist/utils/normalize-path.d.ts +0 -21
  33. package/dist/utils/normalize-path.d.ts.map +0 -1
  34. package/dist/utils/path-utils.d.ts.map +0 -1
  35. package/src/files-api.ts +0 -168
  36. package/src/impl/index.ts +0 -6
  37. package/src/impl/mem-files-api.ts +0 -323
  38. package/src/impl/node-files-api.ts +0 -271
  39. package/src/utils/collect-stream.ts +0 -35
  40. package/src/utils/file-info-utils.ts +0 -15
  41. package/src/utils/index.ts +0 -8
  42. package/src/utils/normalize-path.ts +0 -34
@@ -1,47 +1,100 @@
1
1
 
2
- //#region src/utils/collect-stream.ts
2
+ //#region src/file-utils.ts
3
3
  /**
4
- * Stream collection utilities
4
+ * Collect async iterable chunks into a single Uint8Array.
5
5
  */
6
+ async function collectChunks(chunks) {
7
+ const parts = [];
8
+ let totalLength = 0;
9
+ for await (const chunk of chunks) {
10
+ parts.push(chunk);
11
+ totalLength += chunk.length;
12
+ }
13
+ if (parts.length === 0) return new Uint8Array(0);
14
+ if (parts.length === 1) return parts[0];
15
+ const result = new Uint8Array(totalLength);
16
+ let offset = 0;
17
+ for (const chunk of parts) {
18
+ result.set(chunk, offset);
19
+ offset += chunk.length;
20
+ }
21
+ return result;
22
+ }
6
23
  /**
7
- * Collects all values from an async generator into an array.
24
+ * Read entire file content into a Uint8Array.
25
+ * Returns empty array if file doesn't exist.
8
26
  */
9
- async function collectGenerator(generator) {
10
- const results = [];
11
- for await (const item of generator) results.push(item);
12
- return results;
27
+ async function readFile(files, path) {
28
+ return collectChunks(files.read(path));
13
29
  }
14
30
  /**
15
- * Converts a synchronous iterable to an async iterable.
31
+ * Read entire file content as a UTF-8 string.
32
+ * Returns empty string if file doesn't exist.
16
33
  */
17
- async function* toAsyncIterable(iterable) {
18
- for (const item of iterable) yield item;
34
+ async function readText(files, path) {
35
+ const data = await readFile(files, path);
36
+ return new TextDecoder().decode(data);
19
37
  }
20
38
  /**
21
- * Normalizes BinaryStream to AsyncIterable<Uint8Array>.
39
+ * Read file content, returning undefined if file doesn't exist.
22
40
  */
23
- function toBinaryAsyncIterable(data) {
24
- if (Symbol.asyncIterator in data) return data;
25
- return toAsyncIterable(data);
41
+ async function tryReadFile(files, path) {
42
+ if (!await files.exists(path)) return void 0;
43
+ return readFile(files, path);
44
+ }
45
+ /**
46
+ * Read file content as string, returning undefined if file doesn't exist.
47
+ */
48
+ async function tryReadText(files, path) {
49
+ const data = await tryReadFile(files, path);
50
+ return data ? new TextDecoder().decode(data) : void 0;
51
+ }
52
+ /**
53
+ * Read a specific byte range from a file.
54
+ *
55
+ * @param files - FilesApi instance
56
+ * @param path - File path
57
+ * @param position - Starting byte position
58
+ * @param length - Number of bytes to read
59
+ * @returns Uint8Array with requested bytes (may be shorter if EOF reached)
60
+ */
61
+ async function readRange(files, path, position, length) {
62
+ return collectChunks(files.read(path, {
63
+ start: position,
64
+ length
65
+ }));
26
66
  }
27
-
28
- //#endregion
29
- //#region src/utils/file-info-utils.ts
30
67
  /**
31
- * Check if FileInfo represents a directory
68
+ * Read bytes from a file into a buffer at a specific offset.
69
+ * Similar to Node.js fs.read() signature.
70
+ *
71
+ * @param files - FilesApi instance
72
+ * @param path - File path
73
+ * @param buffer - Target buffer to write into
74
+ * @param bufferOffset - Offset in buffer where to start writing
75
+ * @param length - Number of bytes to read
76
+ * @param position - Position in file where to start reading
77
+ * @returns Number of bytes actually read
32
78
  */
33
- function isDirectory(info) {
34
- return info?.kind === "directory";
79
+ async function readAt(files, path, buffer, bufferOffset, length, position) {
80
+ const data = await readRange(files, path, position, length);
81
+ const bytesToCopy = Math.min(data.length, buffer.length - bufferOffset);
82
+ buffer.set(data.subarray(0, bytesToCopy), bufferOffset);
83
+ return bytesToCopy;
35
84
  }
36
85
  /**
37
- * Check if FileInfo represents a file
86
+ * Write a string to a file as UTF-8.
38
87
  */
39
- function isFile(info) {
40
- return info?.kind === "file";
88
+ async function writeText(files, path, content) {
89
+ await files.write(path, [new TextEncoder().encode(content)]);
41
90
  }
42
91
 
43
92
  //#endregion
44
- //#region src/utils/normalize-path.ts
93
+ //#region src/path-utils.ts
94
+ /**
95
+ * Path manipulation utilities for virtual filesystem paths.
96
+ * All paths use forward slashes and start with "/".
97
+ */
45
98
  /**
46
99
  * Normalizes a file path to a consistent format.
47
100
  * - Adds leading slash if missing
@@ -55,24 +108,6 @@ function normalizePath(filePath) {
55
108
  return `/${segments.join("/")}`;
56
109
  }
57
110
  /**
58
- * Extracts path string from FileRef.
59
- */
60
- function toPath(file) {
61
- return typeof file === "object" ? file.path : String(file);
62
- }
63
- /**
64
- * Normalizes FileRef to a path string.
65
- */
66
- function resolveFileRef(file) {
67
- return normalizePath(toPath(file));
68
- }
69
-
70
- //#endregion
71
- //#region src/utils/path-utils.ts
72
- /**
73
- * Path manipulation utilities
74
- */
75
- /**
76
111
  * Joins path segments with proper normalization.
77
112
  */
78
113
  function joinPath(...segments) {
@@ -108,492 +143,15 @@ function extname(path) {
108
143
  }
109
144
 
110
145
  //#endregion
111
- //#region src/files-api.ts
112
- const IGNORE_FILE = ".ignore";
113
- var FilesApi = class {
114
- constructor(fs) {
115
- this.fs = fs;
116
- }
117
- list(file, options) {
118
- return this.fs.list(file, options);
119
- }
120
- stats(file) {
121
- return this.fs.stats(file);
122
- }
123
- remove(file) {
124
- return this.fs.remove(file);
125
- }
126
- open(file) {
127
- return this.fs.open(file);
128
- }
129
- /**
130
- * Checks if a file or directory exists.
131
- */
132
- async exists(file) {
133
- return await this.stats(file) !== void 0;
134
- }
135
- /**
136
- * Reads file content as a stream.
137
- */
138
- async *read(file, options = {}) {
139
- const handle = await this.open(file);
140
- try {
141
- yield* handle.createReadStream(options);
142
- } finally {
143
- await handle.close();
144
- }
145
- }
146
- /**
147
- * Writes content to a file.
148
- */
149
- async write(file, content) {
150
- const handle = await this.open(file);
151
- try {
152
- await handle.createWriteStream(toBinaryAsyncIterable(content));
153
- } finally {
154
- await handle.close();
155
- }
156
- }
157
- /**
158
- * Reads entire file into a single buffer.
159
- */
160
- async readFile(file) {
161
- const chunks = [];
162
- let totalLength = 0;
163
- for await (const chunk of this.read(file)) {
164
- chunks.push(chunk);
165
- totalLength += chunk.length;
166
- }
167
- if (chunks.length === 0) return new Uint8Array(0);
168
- if (chunks.length === 1) return chunks[0];
169
- const result = new Uint8Array(totalLength);
170
- let offset = 0;
171
- for (const chunk of chunks) {
172
- result.set(chunk, offset);
173
- offset += chunk.length;
174
- }
175
- return result;
176
- }
177
- /**
178
- * Copies file or directory.
179
- * Uses native implementation if available, otherwise falls back to read/write.
180
- */
181
- async copy(source, target, options = {}) {
182
- if (this.fs.copy) return this.fs.copy(source, target, options);
183
- const sourceInfo = await this.stats(source);
184
- if (!sourceInfo) return false;
185
- const sourcePath = resolveFileRef(source);
186
- const targetPath = resolveFileRef(target);
187
- const recursive = options.recursive ?? true;
188
- if (sourceInfo.kind === "directory") for await (const entry of this.list(source, { recursive })) {
189
- if (entry.kind === "directory") continue;
190
- const newTargetPath = targetPath + entry.path.substring(sourcePath.length);
191
- await this.write(newTargetPath, this.read(entry.path));
192
- }
193
- else await this.write(targetPath, this.read(sourcePath));
194
- return true;
195
- }
196
- /**
197
- * Moves file or directory.
198
- * Uses native implementation if available, otherwise falls back to copy+delete.
199
- */
200
- async move(source, target) {
201
- if (this.fs.move) return this.fs.move(source, target);
202
- if (!await this.copy(source, target)) return false;
203
- await this.remove(source);
204
- return true;
205
- }
206
- /**
207
- * Creates a directory.
208
- * Uses native implementation if available, otherwise creates a placeholder file.
209
- */
210
- async mkdir(file) {
211
- if (this.fs.mkdir) return this.fs.mkdir(file);
212
- const placeholderPath = joinPath(resolveFileRef(file), IGNORE_FILE);
213
- await this.write(placeholderPath, [new Uint8Array(0)]);
214
- }
215
- };
216
-
217
- //#endregion
218
- //#region src/impl/mem-files-api.ts
219
- var MemFileHandle = class {
220
- constructor(store, path) {
221
- this.store = store;
222
- this.path = path;
223
- }
224
- get size() {
225
- const entry = this.store.get(this.path);
226
- if (entry?.kind === "file") return entry.content.length;
227
- return 0;
228
- }
229
- getOrCreateFile() {
230
- let entry = this.store.get(this.path);
231
- if (!entry || entry.kind !== "file") {
232
- entry = {
233
- kind: "file",
234
- content: new Uint8Array(0),
235
- lastModified: Date.now()
236
- };
237
- this.store.set(this.path, entry);
238
- }
239
- return entry;
240
- }
241
- async close() {}
242
- async appendFile(data, options = {}) {
243
- const file = this.getOrCreateFile();
244
- const chunks = [file.content];
245
- let bytesWritten = 0;
246
- for await (const chunk of toBinaryAsyncIterable(data)) {
247
- if (options.signal?.aborted) throw new Error("Operation aborted");
248
- chunks.push(chunk);
249
- bytesWritten += chunk.length;
250
- }
251
- const totalLength = chunks.reduce((sum, c) => sum + c.length, 0);
252
- const merged = new Uint8Array(totalLength);
253
- let offset = 0;
254
- for (const chunk of chunks) {
255
- merged.set(chunk, offset);
256
- offset += chunk.length;
257
- }
258
- file.content = merged;
259
- file.lastModified = Date.now();
260
- return bytesWritten;
261
- }
262
- async *createReadStream(options = {}) {
263
- const entry = this.store.get(this.path);
264
- if (!entry || entry.kind !== "file") return;
265
- const { start = 0, end = Infinity, signal } = options;
266
- const bufferSize = 8192;
267
- const content = entry.content;
268
- const actualEnd = Math.min(end, content.length);
269
- let position = start;
270
- while (position < actualEnd) {
271
- if (signal?.aborted) throw new Error("Operation aborted");
272
- const remaining = actualEnd - position;
273
- const toRead = Math.min(bufferSize, remaining);
274
- yield content.subarray(position, position + toRead);
275
- position += toRead;
276
- }
277
- }
278
- async createWriteStream(data, options = {}) {
279
- const { start = 0, signal } = options;
280
- const file = this.getOrCreateFile();
281
- const chunks = [];
282
- let bytesWritten = 0;
283
- if (start > 0 && file.content.length > 0) chunks.push(file.content.subarray(0, Math.min(start, file.content.length)));
284
- if (start > file.content.length) chunks.push(new Uint8Array(start - file.content.length));
285
- for await (const chunk of toBinaryAsyncIterable(data)) {
286
- if (signal?.aborted) throw new Error("Operation aborted");
287
- chunks.push(chunk);
288
- bytesWritten += chunk.length;
289
- }
290
- const totalLength = chunks.reduce((sum, c) => sum + c.length, 0);
291
- const merged = new Uint8Array(totalLength);
292
- let offset = 0;
293
- for (const chunk of chunks) {
294
- merged.set(chunk, offset);
295
- offset += chunk.length;
296
- }
297
- file.content = merged;
298
- file.lastModified = Date.now();
299
- return bytesWritten;
300
- }
301
- async read(buffer, offset, length, position) {
302
- const entry = this.store.get(this.path);
303
- if (!entry || entry.kind !== "file") return 0;
304
- const content = entry.content;
305
- const available = content.length - position;
306
- if (available <= 0) return 0;
307
- const bytesToRead = Math.min(length, available, buffer.length - offset);
308
- buffer.set(content.subarray(position, position + bytesToRead), offset);
309
- return bytesToRead;
310
- }
311
- };
312
- var MemFilesApi = class {
313
- store = /* @__PURE__ */ new Map();
314
- async *list(file, options = {}) {
315
- const normalized = resolveFileRef(file);
316
- const prefix = normalized === "/" ? "/" : `${normalized}/`;
317
- const { recursive = false } = options;
318
- const seen = /* @__PURE__ */ new Set();
319
- for (const [path, entry] of this.store.entries()) {
320
- if (!path.startsWith(prefix)) continue;
321
- const segments = path.substring(prefix.length).split("/");
322
- if (segments.length === 0 || segments[0] === "") continue;
323
- if (segments.length === 1) {
324
- if (seen.has(path)) continue;
325
- seen.add(path);
326
- const info = {
327
- kind: entry.kind,
328
- name: basename(path),
329
- path,
330
- lastModified: entry.lastModified
331
- };
332
- if (entry.kind === "file") info.size = entry.content.length;
333
- yield info;
334
- } else if (recursive) {
335
- if (seen.has(path)) continue;
336
- seen.add(path);
337
- const info = {
338
- kind: entry.kind,
339
- name: basename(path),
340
- path,
341
- lastModified: entry.lastModified
342
- };
343
- if (entry.kind === "file") info.size = entry.content.length;
344
- yield info;
345
- } else {
346
- const dirName = segments[0];
347
- const dirPath = joinPath(normalized, dirName);
348
- if (!seen.has(dirPath)) {
349
- seen.add(dirPath);
350
- yield {
351
- kind: "directory",
352
- name: dirName,
353
- path: dirPath,
354
- lastModified: 0
355
- };
356
- }
357
- }
358
- }
359
- }
360
- async stats(file) {
361
- const normalized = resolveFileRef(file);
362
- const entry = this.store.get(normalized);
363
- if (entry) {
364
- const info = {
365
- kind: entry.kind,
366
- name: basename(normalized),
367
- path: normalized,
368
- lastModified: entry.lastModified
369
- };
370
- if (entry.kind === "file") info.size = entry.content.length;
371
- return info;
372
- }
373
- if (normalized === "/") return {
374
- kind: "directory",
375
- name: "",
376
- path: "/",
377
- lastModified: 0
378
- };
379
- const prefix = `${normalized}/`;
380
- for (const path of this.store.keys()) if (path.startsWith(prefix)) return {
381
- kind: "directory",
382
- name: basename(normalized),
383
- path: normalized,
384
- lastModified: 0
385
- };
386
- }
387
- async remove(file) {
388
- const normalized = resolveFileRef(file);
389
- const prefix = `${normalized}/`;
390
- let removed = false;
391
- if (this.store.delete(normalized)) removed = true;
392
- for (const path of [...this.store.keys()]) if (path.startsWith(prefix)) {
393
- this.store.delete(path);
394
- removed = true;
395
- }
396
- return removed;
397
- }
398
- async open(file) {
399
- const normalized = resolveFileRef(file);
400
- return new MemFileHandle(this.store, normalized);
401
- }
402
- async mkdir(file) {
403
- const normalized = resolveFileRef(file);
404
- if (!this.store.has(normalized)) this.store.set(normalized, {
405
- kind: "directory",
406
- lastModified: Date.now()
407
- });
408
- }
409
- };
410
-
411
- //#endregion
412
- //#region src/impl/node-files-api.ts
413
- /**
414
- * Wraps Node.js FileHandle to implement our FileHandle interface.
415
- */
416
- var NodeFileHandleWrapper = class {
417
- constructor(handle, _size) {
418
- this.handle = handle;
419
- this._size = _size;
420
- }
421
- get size() {
422
- return this._size;
423
- }
424
- async close() {
425
- await this.handle.close();
426
- }
427
- async appendFile(data, options = {}) {
428
- let bytesWritten = 0;
429
- const asyncData = toBinaryAsyncIterable(data);
430
- for await (const chunk of asyncData) {
431
- if (options.signal?.aborted) throw new Error("Operation aborted");
432
- await this.handle.appendFile(chunk);
433
- bytesWritten += chunk.length;
434
- }
435
- this._size = (await this.handle.stat()).size;
436
- return bytesWritten;
437
- }
438
- async *createReadStream(options = {}) {
439
- const { start = 0, end = Infinity, signal } = options;
440
- const bufferSize = 8192;
441
- let position = start;
442
- const actualEnd = Math.min(end, this._size);
443
- while (position < actualEnd) {
444
- if (signal?.aborted) throw new Error("Operation aborted");
445
- const remaining = actualEnd - position;
446
- const toRead = Math.min(bufferSize, remaining);
447
- const buffer = new Uint8Array(toRead);
448
- const { bytesRead } = await this.handle.read(buffer, 0, toRead, position);
449
- if (bytesRead === 0) break;
450
- yield buffer.subarray(0, bytesRead);
451
- position += bytesRead;
452
- }
453
- }
454
- async createWriteStream(data, options = {}) {
455
- const { start = 0, signal } = options;
456
- let position = start;
457
- let bytesWritten = 0;
458
- const asyncData = toBinaryAsyncIterable(data);
459
- await this.handle.truncate(start);
460
- for await (const chunk of asyncData) {
461
- if (signal?.aborted) throw new Error("Operation aborted");
462
- const { bytesWritten: written } = await this.handle.write(chunk, 0, chunk.length, position);
463
- position += written;
464
- bytesWritten += written;
465
- }
466
- this._size = (await this.handle.stat()).size;
467
- return bytesWritten;
468
- }
469
- async chmod(mode) {
470
- await this.handle.chmod(mode);
471
- }
472
- async chown(uid, gid) {
473
- await this.handle.chown(uid, gid);
474
- }
475
- async read(buffer, offset, length, position) {
476
- const actualLength = Math.min(length, buffer.length - offset);
477
- if (actualLength <= 0) return 0;
478
- return (await this.handle.read(buffer, offset, actualLength, position)).bytesRead;
479
- }
480
- };
481
- var NodeFilesApi = class {
482
- fs;
483
- rootDir;
484
- constructor(options) {
485
- this.fs = options.fs;
486
- this.rootDir = options.rootDir ?? "";
487
- }
488
- resolvePath(file) {
489
- const normalized = resolveFileRef(file);
490
- return this.rootDir + normalized;
491
- }
492
- async *list(file, options = {}) {
493
- const dirPath = this.resolvePath(file);
494
- const { recursive = false } = options;
495
- try {
496
- const entries = await this.fs.readdir(dirPath, { withFileTypes: true });
497
- for (const entry of entries) {
498
- const entryPath = joinPath(resolveFileRef(file), entry.name);
499
- const fullPath = this.rootDir + entryPath;
500
- const info = {
501
- kind: entry.isDirectory() ? "directory" : "file",
502
- name: entry.name,
503
- path: entryPath,
504
- lastModified: 0
505
- };
506
- try {
507
- const stat = await this.fs.stat(fullPath);
508
- info.size = stat.size;
509
- info.lastModified = stat.mtimeMs;
510
- } catch {}
511
- yield info;
512
- if (recursive && entry.isDirectory()) yield* this.list(entryPath, options);
513
- }
514
- } catch {}
515
- }
516
- async stats(file) {
517
- const fullPath = this.resolvePath(file);
518
- const normalized = resolveFileRef(file);
519
- try {
520
- const stat = await this.fs.stat(fullPath);
521
- return {
522
- kind: stat.isDirectory() ? "directory" : "file",
523
- name: basename(normalized),
524
- path: normalized,
525
- size: stat.size,
526
- lastModified: stat.mtimeMs
527
- };
528
- } catch {
529
- return;
530
- }
531
- }
532
- async remove(file) {
533
- const fullPath = this.resolvePath(file);
534
- try {
535
- if ((await this.fs.stat(fullPath)).isDirectory()) await this.fs.rm(fullPath, {
536
- recursive: true,
537
- force: true
538
- });
539
- else await this.fs.unlink(fullPath);
540
- return true;
541
- } catch {
542
- return false;
543
- }
544
- }
545
- async open(file) {
546
- const fullPath = this.resolvePath(file);
547
- const normalized = resolveFileRef(file);
548
- const dir = this.rootDir + dirname(normalized);
549
- await this.fs.mkdir(dir, { recursive: true });
550
- const handle = await this.fs.open(fullPath, "a+");
551
- return new NodeFileHandleWrapper(handle, (await handle.stat()).size);
552
- }
553
- async move(source, target) {
554
- const sourcePath = this.resolvePath(source);
555
- const targetPath = this.resolvePath(target);
556
- try {
557
- const targetDir = dirname(targetPath);
558
- await this.fs.mkdir(targetDir, { recursive: true });
559
- await this.fs.rename(sourcePath, targetPath);
560
- return true;
561
- } catch {
562
- return false;
563
- }
564
- }
565
- async copy(source, target, options = {}) {
566
- const sourcePath = this.resolvePath(source);
567
- const targetPath = this.resolvePath(target);
568
- const { recursive = true } = options;
569
- try {
570
- const targetDir = dirname(targetPath);
571
- await this.fs.mkdir(targetDir, { recursive: true });
572
- await this.fs.cp(sourcePath, targetPath, { recursive });
573
- return true;
574
- } catch {
575
- return false;
576
- }
577
- }
578
- async mkdir(file) {
579
- const fullPath = this.resolvePath(file);
580
- await this.fs.mkdir(fullPath, { recursive: true });
581
- }
582
- };
583
-
584
- //#endregion
585
- exports.FilesApi = FilesApi;
586
- exports.MemFilesApi = MemFilesApi;
587
- exports.NodeFilesApi = NodeFilesApi;
588
146
  exports.basename = basename;
589
- exports.collectGenerator = collectGenerator;
590
147
  exports.dirname = dirname;
591
148
  exports.extname = extname;
592
- exports.isDirectory = isDirectory;
593
- exports.isFile = isFile;
594
149
  exports.joinPath = joinPath;
595
150
  exports.normalizePath = normalizePath;
596
- exports.resolveFileRef = resolveFileRef;
597
- exports.toAsyncIterable = toAsyncIterable;
598
- exports.toBinaryAsyncIterable = toBinaryAsyncIterable;
599
- exports.toPath = toPath;
151
+ exports.readAt = readAt;
152
+ exports.readFile = readFile;
153
+ exports.readRange = readRange;
154
+ exports.readText = readText;
155
+ exports.tryReadFile = tryReadFile;
156
+ exports.tryReadText = tryReadText;
157
+ exports.writeText = writeText;