Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/proc/legacy/deps.ts>readLines

A high-level way to run child processes that is easy, flexible, powerful, and prevents resource leaks.
Go to Latest
function readLines
import { readLines } from "https://deno.land/x/proc@0.20.27/legacy/deps.ts";

Read strings line-by-line from a Reader.

Examples

Example 1

import { readLines } from "https://deno.land/std@0.224.0/io/read_lines.ts";
import * as path from "https://deno.land/std@0.224.0/path/mod.ts";

const filename = path.join(Deno.cwd(), "std/io/README.md");
let fileReader = await Deno.open(filename);

for await (let line of readLines(fileReader)) {
  console.log(line);
}

Parameters

reader: Reader
optional
decoderOpts: { encoding?: string; fatal?: boolean; ignoreBOM?: boolean; }

Returns

AsyncIterableIterator<string>