Bun

interface

fs.promises.WriterOptions

interface WriterOptions

  • autoClose?: boolean

    Close the file handle when the writer ends or fails.

  • chunkSize?: number

    Maximum chunk size in bytes for synchronous write operations. Writes larger than this threshold fall back to async I/O. Set this to match the reader's chunkSize for optimal pipeTo() performance.

  • limit?: number

    Maximum number of bytes the writer will accept. Async writes (write(), writev()) that would exceed the limit reject with ERR_OUT_OF_RANGE. Sync writes (writeSync(), writevSync()) return false.

  • start?: number

    Byte offset to start writing at. When specified, writes use explicit positioning.