MCPcopy Create free account
hub / github.com/nodejs/node / write

Method write

lib/internal/streams/iter/broadcast.js:533–542  ·  view source on GitHub ↗
(chunk, options)

Source from the content-addressed store, hash-verified

531 }
532
533 write(chunk, options) {
534 // Fast path: no signal, writer open, buffer has space
535 if (this.#canUseWriteFastPath(options)) {
536 const converted = toUint8Array(chunk);
537 this.#broadcast[kWrite]([converted]);
538 this.#totalBytes += TypedArrayPrototypeGetByteLength(converted);
539 return kResolvedPromise;
540 }
541 return this.#writevSlow([chunk], options);
542 }
543
544 writev(chunks, options) {
545 if (!ArrayIsArray(chunks)) {

Callers 1

pumpFunction · 0.45

Calls 3

#canUseWriteFastPathMethod · 0.95
#writevSlowMethod · 0.95
toUint8ArrayFunction · 0.85

Tested by

no test coverage detected