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

Function wrap

test/sequential/test-net-GH-5504.js:91–98  ·  view source on GitHub ↗
(inp, out, w)

Source from the content-addressed store, hash-verified

89 }));
90
91 function wrap(inp, out, w) {
92 inp.setEncoding('utf8');
93 inp.on('data', function(chunk) {
94 chunk = chunk.trim();
95 if (!chunk) return;
96 out.write(`${w}${chunk.split('\n').join(`\n${w}`)}\n`);
97 });
98 }
99}

Calls 5

setEncodingMethod · 0.45
onMethod · 0.45
writeMethod · 0.45
joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…