opfs-worker 1.0.0 → 1.1.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.
package/README.md CHANGED
@@ -345,6 +345,11 @@ Check out the live demo powered by Vite and hosted on GitHub Pages.
345
345
 
346
346
  The complete API reference is available in the [docs/api-reference.md](docs/api-reference.md) file.
347
347
 
348
+ **Additional Documentation:**
349
+
350
+ - [File Descriptors Guide](docs/file-descriptors.md) - Comprehensive guide to low-level file I/O operations
351
+ - [Types Reference](docs/types.md) - Complete TypeScript type definitions
352
+
348
353
  ### Quick API Overview
349
354
 
350
355
  **Entry Points:**
@@ -363,6 +368,20 @@ The complete API reference is available in the [docs/api-reference.md](docs/api-
363
368
  - `copy(source, destination, options?)` - Copy files/directories
364
369
  - `rename(oldPath, newPath)` - Rename files/directories
365
370
 
371
+ **File Descriptors (Low-level I/O):**
372
+
373
+ - `open(path, options?)` - Open file and return descriptor
374
+ - `read(fd, buffer, offset, length, position?)` - Read from descriptor (returns `{bytesRead, buffer}`)
375
+ - `write(fd, buffer, offset?, length?, position?)` - Write to descriptor
376
+ - `fstat(fd)` - Get stats by descriptor
377
+ - `ftruncate(fd, size?)` - Truncate file by descriptor
378
+ - `fsync(fd)` - Sync file data to storage
379
+ - `close(fd)` - Close file descriptor
380
+
381
+ **Note**: The `read()` method uses `Comlink.transfer()` for efficient buffer handling. **From the main window**, you must transfer buffer ownership to the worker, and **from the worker**, the buffer is transferred back to you. See [File Descriptors Guide](docs/file-descriptors.md) for complete usage examples.
382
+
383
+ _For detailed file descriptor documentation, see [File Descriptors Guide](docs/file-descriptors.md)_
384
+
366
385
  **Advanced Features:**
367
386
 
368
387
  - `watch(path, options?)` - Watch for file changes with minimatch patterns