The absolute path of the file to write to.
The content to write (string, ArrayBuffer, TypedArray, Blob, or ReadableStream
Optionaloptions: WriteOptionsOptional write options.
Options for writing files, including flags for creation and appending.
Optionalappend?: booleanWhether to append to the file if it already exists.
Optionalcreate?: booleanWhether to create the file if it does not exist.
A promise that resolves to an AsyncVoidIOResult indicating success or failure.
Writes content to a file at the specified path. Creates the file and parent directories if they don't exist (unless
create: false).When writing a
ReadableStreamto a new file, the stream is first written to a temporary file in/tmp, then moved to the target path upon success. This prevents leaving incomplete files if the stream is interrupted. For existing files, writes are performed directly since OPFS's transactional writes preserve the original content on failure.