pipe

abstract fun pipe(destination: Writable)

The readable.pipe() method attaches a Writable stream to the readable, causing it to switch into flowing mode.

Data is read from the Readable source and passed to the supplied Writable destination. The destination is generally a Writable stream, but may be any object that implements the Writable stream interface.

The options argument is an optional object that may contain the following properties:

  • end - A boolean that specifies whether or not the destination should be automatically closed when the source ends. Default: true.

This method variant takes only a destination; see other variants for additional options.

Parameters

destination

The destination for writing data.


abstract fun pipe(destination: Writable, options: Value)

The readable.pipe() method attaches a Writable stream to the readable, causing it to switch into flowing mode.

Data is read from the Readable source and passed to the supplied Writable destination. The destination is generally a Writable stream, but may be any object that implements the Writable stream interface.

The options argument is an optional object that may contain the following properties:

  • end - A boolean that specifies whether or not the destination should be automatically closed when the source ends. Default: true.

This method variant takes a destination and options, expressed as a guest Value.

Parameters

destination

The destination for writing data.

options

The options for the pipe operation.


abstract fun pipe(destination: Writable, options: ReadablePipeOptions)

The readable.pipe() method attaches a Writable stream to the readable, causing it to switch into flowing mode.

Data is read from the Readable source and passed to the supplied Writable destination. The destination is generally a Writable stream, but may be any object that implements the Writable stream interface.

The options argument is an optional object that may contain the following properties:

  • end - A boolean that specifies whether or not the destination should be automatically closed when the source ends. Default: true.

This method variant takes a destination and options, expressed as a ReadablePipeOptions.

Parameters

destination

The destination for writing data.

options

The options for the pipe operation.