The locked read-only property of the WritableStream interface returns a boolean indicating whether the WritableStream is locked to a writer.
Optional_ReadonlyparamsThe abort() method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.
Optional_reason: unknownThe close() method of the WritableStream interface closes the associated stream.
The getWriter() method of the WritableStream interface returns a new instance of WritableStreamDefaultWriter and locks the stream to that instance.
WritableStream that outputs to console with JSON log-level parsing.
Decodes stream chunks and attempts to parse as JSON to extract log levels. Routes messages to console.log/warn/error based on parsed level field. Falls back to console.log for non-JSON content. Useful for structured logging.
Example