wip
This commit is contained in:
parent
cc89f0c75c
commit
afd28d934e
26 changed files with 2103 additions and 427 deletions
11
data-pipeline/utils/create-line-reader.ts
Normal file
11
data-pipeline/utils/create-line-reader.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import fs from "fs";
|
||||
import readline from "readline";
|
||||
|
||||
/**
|
||||
* Creates a line-by-line reader stream for a given file path.
|
||||
*/
|
||||
export function createLineReader(sourcePath: string): readline.Interface {
|
||||
const fileStream = fs.createReadStream(sourcePath, "utf-8");
|
||||
|
||||
return readline.createInterface({ input: fileStream, crlfDelay: Infinity });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue