MCPcopy Index your code
hub / github.com/markmap/markmap / createStreamBody

Function createStreamBody

packages/markmap-cli/src/util/common.ts:43–59  ·  view source on GitHub ↗
(stream: ReadStream)

Source from the content-addressed store, hash-verified

41}
42
43export function createStreamBody(stream: ReadStream) {
44 const body = new ReadableStream({
45 start(controller) {
46 stream.on('data', (chunk) => {
47 controller.enqueue(chunk);
48 });
49 stream.on('end', () => {
50 controller.close();
51 });
52 },
53
54 cancel() {
55 stream.destroy();
56 },
57 });
58 return body;
59}
60
61export const config = {
62 distDir,

Callers 2

downloadAssetFunction · 0.90
sendStaticFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected