JavaScripture
Contribute via GitHub
Feedback
WritableStream
Constructors
Instance Properties
locked
Instance Methods
abort
close
getWriter
Streams API
All API
No API set selected.
WritableStream
:
Object
constructor
Represents a writable stream of data.
Spec
Constructors
new
WritableStream
(
[
sink
:
WritableStreamSink
,
[
strategy
:
QueuingStrategy
]
]
) :
WritableStream
Creates a new WritableStream.
Example:
const stream = new WritableStream({ start() { console.log('start'); }, write(chunk) { console.log('chunk:', chunk); }, close() { console.log('close'); } }); const writer = stream.getWriter(); writer.write('a'); writer.write('b'); writer.write('c'); writer.close();
Run
Results:
Spec
Instance Properties
locked
:
Boolean
readonly
Spec
Instance Methods
abort
(
[
reason
:
Object
]
) :
Promise
<
undefined
>
Spec
close
() :
Promise
<
undefined
>
Spec
getWriter
() :
WritableStreamDefaultWriter
Spec
home
license
contribute
feedback
toggle light/dark mode
Copyright © JavaScripture Contributors