MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / writeJson

Function writeJson

js/botasaurus-server-js/src/writer-http.ts:54–65  ·  view source on GitHub ↗
(data: any, raw: any)

Source from the content-addressed store, hash-verified

52}
53
54function writeJson(data: any, raw: any) {
55 const writer = new HTTPJSONWriteStream(raw);
56 writer.preStart();
57
58 for (let index = 0; index < data.length; index++) {
59 const element = data[index];
60 applyFunctionToResultSync(element, (x) => {
61 return writer.push(x);
62 });
63 }
64 writer.end();
65}
66
67async function writeCsvStreamed(inputFilePath: any, raw: any, streamFn: any) {
68 const writer = new HTTPCSVWriteStream(raw);

Callers

nothing calls this directly

Calls 4

preStartMethod · 0.95
pushMethod · 0.95
endMethod · 0.45

Tested by

no test coverage detected