18 lines
571 B
TypeScript
18 lines
571 B
TypeScript
|
import { TextLineStream } from "jsr:@std/streams@1/text-line-stream";
|
||
|
|
||
|
import { ExportEntry } from "./directory-tailer.ts";
|
||
|
import { tailer } from "./main.ts";
|
||
|
|
||
|
export const fullScan = async () => {
|
||
|
using exports = await Deno.open("./data/exports.jsonl", { read: true });
|
||
|
const lineStream = exports.readable
|
||
|
.pipeThrough(new TextDecoderStream())
|
||
|
.pipeThrough(new TextLineStream());
|
||
|
for await (const line of lineStream.values()) {
|
||
|
const entry = JSON.parse(line) as unknown as ExportEntry;
|
||
|
await tailer.processRecord(entry);
|
||
|
}
|
||
|
};
|
||
|
|
||
|
await fullScan();
|