PUBLIC
ReadableStream
Constructors
Instance Properties
locked
Instance Methods
cancel
getReader
pipeThrough
pipeTo
tee
Streams API
All API
No API set selected.
JavaScript
ReadableStream
:
Object
constructor
Represents a stream of data.
Spec
Constructors
new
ReadableStream
(
[
underlyingSource
:
Object
,
[
strategy
:
Object
]
]
) :
ReadableStream
Instance Properties
locked
:
Boolean
readonly
Instance Methods
cancel
(
[
reason
:
Object
]
) :
Promise
<
undefined
>
getReader
(
[
options
:
Object
]
) :
ReadableStreamDefaultReader
options
: {
mode
String
Either
undefined
or
'byob'
}
Example:
const res = await fetch('/fireworks.ogv'); const reader = res.body.getReader(); let result; while (!(result = await reader.read()).done) { console.log('chunk size:', result.value.byteLength); }
Run
Results:
pipeThrough
(
transform
:
Object
,
[
options
:
Object
]
) :
undefined
transform
: {
readable
ReadableStream
writable
WritableStream
}
options
: {
signal
AbortSignal
preventAbort
Boolean
preventCancel
Boolean
preventClose
Boolean
}
pipeTo
(
destination
:
WritableStream
,
[
options
:
Object
]
) :
undefined
options
: {
signal
AbortSignal
preventAbort
Boolean
preventCancel
Boolean
preventClose
Boolean
}
tee
() :
Array
<
ReadableStream
>
home
license
contribute
feedback
Copyright © PUBLIC Contributors