MCPcopy Create free account
hub / github.com/csskit/csskit / streamToBuffer

Function streamToBuffer

website/script/index.js:88–98  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

86 },
87 });
88const streamToBuffer = async (stream) => {
89 const reader = stream.getReader();
90 const data = [];
91 while (true) {
92 const { done, value } = await reader.read();
93 if (done) return new Uint8Array(data);
94 if (result.value) {
95 data.push(...value);
96 }
97 }
98};
99
100class CodeStorage {
101 constructor(store) {

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected