Releases the underlying reader and cancels the stream.
Returns the next n bytes without consuming them.
Number of bytes to inspect.
OptionaltimeoutMs: number
Optional deadline.
A copy of the next n bytes.
Reads one line terminated by LF, returning it decoded as UTF-8 with the trailing CRLF or LF stripped. Suitable for the text line protocols (SMTP, IMAP, POP3).
OptionaltimeoutMs: number
Optional deadline.
The line without its terminator.
Reads and consumes exactly n bytes.
Number of bytes to read.
OptionaltimeoutMs: number
Optional deadline; rejects with TimeoutError if exceeded.
The n bytes read.
Reads and consumes bytes up to and including the first occurrence of delim.
The delimiter to scan for.
Optionalmax: number
Optional cap on bytes scanned before failing (guards against a peer that never sends the delimiter).
OptionaltimeoutMs: number
Optional deadline.
Everything up to and including delim.
Reads exact byte counts and delimited frames from a byte stream, hiding TCP chunking.
Reads are buffered: a single underlying chunk may satisfy several
readNcalls, and a singlereadNmay consume several chunks. Only one underlying read is ever in flight, so areadNthat rejects with TimeoutError leaves any late-arriving bytes in the buffer for the next call rather than dropping them.Since
1.0.0