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

Function _write

lib/internal/streams/iter/classic.js:773–793  ·  view source on GitHub ↗
(chunk, encoding, cb)

Source from the content-addressed store, hash-verified

771 // from _write/_writev/_final callbacks.
772
773 function _write(chunk, encoding, cb) {
774 const bytes = typeof chunk === 'string' ?
775 Buffer.from(chunk, encoding) : chunk;
776 if (hasWriteSync) {
777 try {
778 if (writer.writeSync(bytes)) {
779 queueMicrotask(cb);
780 return;
781 }
782 // WriteSync returned false: not accepted, fall through to async.
783 } catch (err) {
784 cb(err);
785 return;
786 }
787 }
788 try {
789 PromisePrototypeThen(writer.write(bytes), () => cb(), cb);
790 } catch (err) {
791 cb(err);
792 }
793 }
794
795 function _writev(entries, cb) {
796 const chunks = [];

Callers

nothing calls this directly

Calls 5

queueMicrotaskFunction · 0.85
cbFunction · 0.50
fromMethod · 0.45
writeSyncMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…