Files
calendar-optimizer-deno/index.ts
T
2023-04-26 00:48:50 -04:00

16 lines
508 B
TypeScript

import { open } from 'npm:lmdb';
import { CsvParseStream } from 'https://deno.land/std@0.184.0/csv/mod.ts';
const fileStream = (await Deno.open('/home/brian/Downloads/options-data/2013-01-02options.cvs', {read: true})).readable;
const csvParseStream = new CsvParseStream({skipFirstRow: true});
const rowStream = fileStream
.pipeThrough(new TextDecoderStream())
.pipeThrough(csvParseStream)
;
const rowReader = rowStream.getReader();
for(let i = 0; i<20; i++){
console.log(await rowReader.read());
}