window.TransformStream
See: Web APIs - TransformStream
TransformStream(transformer, writableStrategy, readableStrategy)
Cretes a new TransformStream object wrapping the provided transformer. If no transformer argument is supplied, then the result will be an identity transform stream.
Param
Type
Description
transformer
ObjectDefines algorithms for the specific transformation to be performed.
transformer.start
functionCalled when the TransfromStream is constructed.
transformer.transform
functionCalled when a chunk written to the writable is ready to be transformed. If no transform method is supplied, the identity transform is used.
transformer.flush
functionCalled after all chunks written to the writable have been successfully transformed, and the writable is about to be closed.
writableStrategy
ObjectQueuing strategy for the stream.
writableStrategy.highWaterMark
numberA non-negative number. The total number of chunks that can be contained in the internal queue before backpressure is applied
writableStrategy.size
functionThe size to use for each chunk, in bytes.
readableStrategy
ObjectQueuing strategy for the stream.
readableStrategy.highWaterMark
numberA non-negative number. The total number of chunks that can be contained in the internal queue before backpressure is applied
readableStrategy.size
functionThe size to use for each chunk, in bytes.
readable : ReadableStream
ReadableStream representing the readable of this TransformStream.
writable : WritableStream
WritableStream representing the writable of this TransformStream.