Class WriteStream

Hierarchy

  • Writable
    • WriteStream

Implements

  • WriteStream

Constructors

  • Parameters

    • Optionalopts: WritableOptions

    Returns WriteStream

Properties

_readableState: ReadableState
_writableState: WritableState
"[asyncDispose]": never
bytesWritten: number

The number of bytes written so far. Does not include data that is still queued for writing.

v0.4.7

closed: boolean
destroyed: boolean
errored: null | Error
path: string | Buffer<ArrayBufferLike>

The path to the file the stream is writing to as specified in the first argument to createWriteStream. If path is passed as a string, thenwriteStream.path will be a string. If path is passed as a Buffer, thenwriteStream.path will be a Buffer.

v0.1.93

pending: boolean

This property is true if the underlying file has not been opened yet, i.e. before the 'ready' event is emitted.

v11.2.0

readable: boolean
readableFlowing: null | boolean
readableHighWaterMark: number
readableLength: number
writable: boolean
writableCorked: never
writableEnded: never
writableFinished: never
writableHighWaterMark: number
writableLength: number
writableNeedDrain: boolean
writableObjectMode: never

Methods

  • Parameters

    • error: null | Error
    • callback: (error: null | Error) => void

    Returns void

  • Parameters

    • callback: (error?: null | Error) => void

    Returns void

  • Parameters

    • size: number

    Returns void

  • Returns void

  • Parameters

    • chunk: any
    • encoding: string
    • callback: (error?: null | Error) => void

    Returns void

  • Parameters

    • chunks: { chunk: any; encoding: string }[]
    • callback: (error?: null | Error) => void

    Returns void

  • Returns AsyncIterableIterator<any, any, any>

  • Event emitter The defined events on documents including:

    1. close
    2. drain
    3. error
    4. finish
    5. pipe
    6. unpipe

    Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. drain
    3. error
    4. finish
    5. pipe
    6. unpipe

    Parameters

    • event: "drain"
    • listener: () => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. drain
    3. error
    4. finish
    5. pipe
    6. unpipe

    Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. drain
    3. error
    4. finish
    5. pipe
    6. unpipe

    Parameters

    • event: "finish"
    • listener: () => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. drain
    3. error
    4. finish
    5. pipe
    6. unpipe

    Parameters

    • event: "pipe"
    • listener: (src: Readable) => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. drain
    3. error
    4. finish
    5. pipe
    6. unpipe

    Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void

    Returns this

  • Event emitter The defined events on documents including:

    1. close
    2. drain
    3. error
    4. finish
    5. pipe
    6. unpipe

    Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • Optionaloptions: SignalOption

    Returns Readable

  • Closes writeStream. Optionally accepts a callback that will be executed once the writeStreamis closed.

    Parameters

    Returns void

    v0.9.4

  • Type Parameters

    • T extends ReadableStream

    Parameters

    • stream: ComposeFnParam | T | Iterable<T, any, any> | AsyncIterable<T, any, any>
    • Optionaloptions: { signal: AbortSignal }

    Returns T

  • Returns void

  • Parameters

    • Optionalerror: Error

    Returns this

  • Parameters

    • limit: number
    • Optionaloptions: SignalOption

    Returns Readable

  • Parameters

    • event: "close"

    Returns boolean

  • Parameters

    • event: "drain"

    Returns boolean

  • Parameters

    • event: "error"
    • err: Error

    Returns boolean

  • Parameters

    • event: "finish"

    Returns boolean

  • Parameters

    • event: "pipe"
    • src: Readable

    Returns boolean

  • Parameters

    • event: "unpipe"
    • src: Readable

    Returns boolean

  • Parameters

    • event: string | symbol
    • ...args: any[]

    Returns boolean

  • Parameters

    • Optionalcb: () => void

    Returns this

  • Parameters

    • chunk: any
    • Optionalcb: () => void

    Returns this

  • Parameters

    • chunk: any
    • Optionalencoding: string
    • Optionalcb: () => void

    Returns this

  • Returns (string | symbol)[]

  • Parameters

    • fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>
    • Optionaloptions: ArrayOptions

    Returns Promise<boolean>

  • Parameters

    • fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>
    • Optionaloptions: ArrayOptions

    Returns Readable

  • Type Parameters

    • T

    Parameters

    • fn: (data: any, options?: SignalOption) => data is T
    • Optionaloptions: ArrayOptions

    Returns Promise<undefined | T>

  • Parameters

    • fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>
    • Optionaloptions: ArrayOptions

    Returns Promise<any>

  • Parameters

    • fn: (data: any, options?: SignalOption) => any
    • Optionaloptions: ArrayOptions

    Returns Readable

  • Parameters

    • fn: (data: any, options?: SignalOption) => void | Promise<void>
    • Optionaloptions: ArrayOptions

    Returns Promise<void>

  • Returns number

  • Returns boolean

  • Parameters

    • Optionaloptions: { destroyOnReturn?: boolean }

    Returns AsyncIterableIterator<any, any, any>

  • Parameters

    • eventName: string | symbol

    Returns number

  • Parameters

    • eventName: string | symbol

    Returns Function[]

  • Parameters

    • fn: (data: any, options?: SignalOption) => any
    • Optionaloptions: ArrayOptions

    Returns Readable

  • Parameters

    • eventName: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Returns this

  • Type Parameters

    • T extends _IWritable

    Parameters

    • destination: T
    • Optionaloptions: { end?: boolean }

    Returns T

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Parameters

    • chunk: any
    • Optionalencoding: string

    Returns boolean

  • Parameters

    • eventName: string | symbol

    Returns Function[]

  • Parameters

    • Optionalsize: number

    Returns any

  • Type Parameters

    • T = any

    Parameters

    • fn: (previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T
    • Optionalinitial: undefined
    • Optionaloptions: Pick<ArrayOptions, "signal">

    Returns Promise<T>

  • Type Parameters

    • T = any

    Parameters

    • fn: (previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T
    • initial: T
    • Optionaloptions: Pick<ArrayOptions, "signal">

    Returns Promise<T>

  • Parameters

    • Optionalevent: string | symbol

    Returns this

  • Parameters

    • event: "close"
    • listener: () => void

    Returns this

  • Parameters

    • event: "drain"
    • listener: () => void

    Returns this

  • Parameters

    • event: "error"
    • listener: (err: Error) => void

    Returns this

  • Parameters

    • event: "finish"
    • listener: () => void

    Returns this

  • Parameters

    • event: "pipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: "unpipe"
    • listener: (src: Readable) => void

    Returns this

  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void

    Returns this

  • Returns this

  • Parameters

    • encoding: string

    Returns this

  • Parameters

    • encoding: string

    Returns this

  • Parameters

    • n: number

    Returns this

  • Parameters

    • fn: (data: any, options?: SignalOption) => boolean | Promise<boolean>
    • Optionaloptions: ArrayOptions

    Returns Promise<boolean>

  • Parameters

    • limit: number
    • Optionaloptions: SignalOption

    Returns Readable

  • Parameters

    • Optionaloptions: SignalOption

    Returns Promise<any[]>

  • Returns void

  • Parameters

    • Optionaldestination: Writable

    Returns this

  • Parameters

    • chunk: any

    Returns void

  • Parameters

    • oldStream: Readable

    Returns this

  • Parameters

    • chunk: any
    • Optionalcb: (error: undefined | null | Error) => void

    Returns boolean

  • Parameters

    • chunk: any
    • Optionalencoding: string
    • Optionalcb: (error: undefined | null | Error) => void

    Returns boolean