MCPcopy Create free account
hub / github.com/NaturalIntelligence/fast-xml-parser / readToEnd

Method readToEnd

src/cli/read.js:23–42  ·  view source on GitHub ↗
(stream, options, callback)

Source from the content-addressed store, hash-verified

21 }
22
23 static readToEnd(stream, options, callback) {
24 if (typeof options === 'function') {
25 callback = options;
26 options = {};
27 }
28
29 const dest = new ReadToEnd(options);
30
31 stream.pipe(dest);
32
33 stream.on('error', (err) => {
34 stream.unpipe(dest);
35 callback(err);
36 });
37
38 dest.on('complete', callback);
39 dest.resume();
40
41 return dest;
42 }
43}

Callers 1

cli.jsFile · 0.80

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected