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

std/io/buffer.ts>Buffer#readFrom

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method Buffer.prototype.readFrom
import { Buffer } from "https://deno.land/std@0.98.0/io/buffer.ts";

Reads data from r until EOF (null) and appends it to the buffer, growing the buffer as needed. It resolves to the number of bytes read. If the buffer becomes too large, .readFrom() will reject with an error.

Based on Go Lang's Buffer.ReadFrom.

Parameters

r: Reader

Returns

Promise<number>