Oliver Kaup b310dc969b day 2
2024-12-11 14:27:30 +01:00

11 lines
339 B
TypeScript

export async function readLines(path: string) {
const decoder = new TextDecoder("utf-8");
const inputData = await Deno.readFile(path);
const input = decoder.decode(inputData);
// console.log(input.substring(0,50) + '...');
const lines = input.split('\n')
.filter( l => l.trim() !== '');
return lines
}