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

std/encoding/binary.ts>readVarnum

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function readVarnum
import { readVarnum } from "https://deno.land/std@0.38.0/encoding/binary.ts";

Reads a number from r, comsuming sizeof(o.dataType) bytes. Data-type defaults to int32.

Returns it as number, or throws Deno.errors.UnexpectedEof if not enough bytes can be read.

Parameters

r: Deno.Reader
optional
o: VarnumOptions = [UNSUPPORTED]

Returns

Promise<number>