MCPcopy Index your code
hub / github.com/nodejs/node / write

Method write

lib/internal/webstreams/writablestream.js:478–487  ·  view source on GitHub ↗

* @param {any} [chunk] * @returns {Promise }

(chunk = undefined)

Source from the content-addressed store, hash-verified

476 * @returns {Promise<void>}
477 */
478 write(chunk = undefined) {
479 if (!isWritableStreamDefaultWriter(this))
480 return PromiseReject(new ERR_INVALID_THIS('WritableStreamDefaultWriter'));
481 if (this[kState].stream === undefined) {
482 return PromiseReject(
483 new ERR_INVALID_STATE.TypeError(
484 'Writer is not bound to a WritableStream'));
485 }
486 return writableStreamDefaultWriterWrite(this, chunk);
487 }
488
489 [kInspect](depth, options) {
490 return customInspect(depth, options, this[kType], {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected