MCPcopy
hub / github.com/BuilderIO/gpt-crawler / writeBatchToFile

Function writeBatchToFile

src/core.ts:182–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

180 `${config.outputFileName.replace(/\.json$/, "")}-${fileCounter}.json`;
181
182 const writeBatchToFile = async (): Promise<void> => {
183 nextFileNameString = nextFileName();
184 await writeFile(
185 nextFileNameString,
186 JSON.stringify(currentResults, null, 2),
187 );
188 console.log(
189 `Wrote ${currentResults.length} items to ${nextFileNameString}`,
190 );
191 currentResults = [];
192 currentSize = 0;
193 fileCounter++;
194 };
195
196 let estimatedTokens: number = 0;
197

Callers 2

addContentOrSplitFunction · 0.85
writeFunction · 0.85

Calls 1

nextFileNameFunction · 0.85

Tested by

no test coverage detected