Opens a file and returns a writable stream for writing contents. Useful for writing large files without loading them entirely into memory. The caller is responsible for closing the stream when done.
The absolute path of the file to write.
Optional
Optional write options.
A promise that resolves to an AsyncIOResult containing a FileSystemWritableFileStream.
AsyncIOResult
FileSystemWritableFileStream
1.0.0
writeFile for general file writing
(await openWritableFileStream('/path/to/large-file.bin')) .inspect(async stream => { try { await stream.write(new Uint8Array([1, 2, 3])); await stream.write(new Uint8Array([4, 5, 6])); } finally { await stream.close(); } }); Copy
(await openWritableFileStream('/path/to/large-file.bin')) .inspect(async stream => { try { await stream.write(new Uint8Array([1, 2, 3])); await stream.write(new Uint8Array([4, 5, 6])); } finally { await stream.close(); } });
Opens a file and returns a writable stream for writing contents. Useful for writing large files without loading them entirely into memory. The caller is responsible for closing the stream when done.