123456789101112131415161718 |
- import * as fs from "fs";
- import * as readline from "readline";
- export async function LoadInput(dayNumber: number): Promise<string[]> {
- const contents = [];
- const stream = fs.createReadStream(`./inputs/${dayNumber}.txt`, "utf8");
- const rl = readline.createInterface({
- input: stream,
- crlfDelay: Infinity,
- });
- for await (const line of rl) {
- contents.push(line);
- }
- return contents;
- }
|