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)
method BufReader.prototype.readLine
BufReader.prototype.readLine(): Promise<ReadLineResult | null>

readLine() is a low-level line-reading primitive. Most callers should use readString('\n') instead or use a Scanner.

readLine() tries to return a single line, not including the end-of-line bytes. If the line was too long for the buffer then more is set and the beginning of the line is returned. The rest of the line will be returned from future calls. more will be false when returning the last fragment of the line. The returned buffer is only valid until the next call to readLine().

The text returned from ReadLine does not include the line end ("\r\n" or "\n").

When the end of the underlying stream is reached, the final bytes in the stream are returned. No indication or error is given if the input ends without a final line end. When there are no more trailing bytes to read, readLine() returns null.

Calling unreadByte() after readLine() will always unread the last byte read (possibly a character belonging to the line end) even if that byte is not part of the line returned by readLine().

Return Type

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 { BufReader } from "@std/io/buf_reader";
or

Import directly with a jsr specifier

import { BufReader } from "jsr:@std/io/buf_reader";