MCPcopy
hub / github.com/adaltas/node-csv / read

Function read

packages/csv-parse/bench/async.iterator.js:24–36  ·  view source on GitHub ↗
(length, source)

Source from the content-addressed store, hash-verified

22};
23
24const read = async function (length, source) {
25 let count = 0;
26 const parser = fs
27 .createReadStream(source, {
28 highWaterMark: 64 * 64 * 1024,
29 })
30 .pipe(parse());
31 /* eslint-disable @typescript-eslint/no-unused-vars */
32 for await (const record of parser) {
33 count++;
34 }
35 assert.strictEqual(count, length);
36};
37
38const dispose = async function (source) {
39 await fs.promises.unlink(source);

Callers 1

mainFunction · 0.70

Calls 1

parseFunction · 0.90

Tested by

no test coverage detected