Skip to content

handles

Documentation / @wtf/platform-fs-node / handles

Handles of the WHATWG File System Standard over Node’s own file system: nodeDirectory, the handle of a folder of the disk, by @wtf/platform-fs-adapter given node:fs/promises. A file is read as it streams, and written on a file beside it, which takes its place, of the file’s mode, as the writable closes; what Node throws is the standard’s DOMException. A file’s handle opens it synchronously, by createSyncAccessHandle(), of node:fs.

const root = await nodeDirectory('out', { create: true })
const file = await root.getFileHandle('notes.md', { create: true })
await new Blob(['# Notes\n']).stream().pipeTo(await file.createWritable())

Variables

Functions