Skip to main content

@std/io@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score70%
Published2 years ago (0.215.0)
function readLines
readLines(
reader: Reader,
decoderOpts?: { encoding?: string; fatal?: boolean; ignoreBOM?: boolean; }
): AsyncIterableIterator<string>
Deprecated

(will be removed after 1.0.0) Use the Web Streams API instead.

Read strings line-by-line from a Reader.

Examples

Example 1

import { readLines } from "@std/io/read_lines";
import * as path from "@std/path";

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

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

Return Type

AsyncIterableIterator<string>

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/io

Import symbol

import { readLines } from "@std/io/read_lines";
or

Import directly with a jsr specifier

import { readLines } from "jsr:@std/io/read_lines";