mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
14 lines
293 B
TypeScript
14 lines
293 B
TypeScript
import { Readable } from "node:stream";
|
|
import { createInterface } from "node:readline";
|
|
|
|
const input = Readable.from(`
|
|
l1
|
|
l2
|
|
l3
|
|
`);
|
|
|
|
const stream = createInterface({ input });
|
|
|
|
const lines = await Array.fromAsync(stream, (str) => str.trim());
|
|
|
|
console.log(lines.filter(Boolean));
|