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
Deprecated
Deprecated

(will be removed after 0.205.0) Use ReadableStreamBYOBReader and DataView instead.

Decodes a number from r, consuming sizeof(o.dataType) bytes. If less than sizeof(o.dataType) bytes were read, throws Deno.errors.unexpectedEof.

o.dataType defaults to "int32".

import { readVarnum } from "https://deno.land/std@0.201.0/encoding/binary.ts";

Parameters

optional
o: VarnumOptions = [UNSUPPORTED]

Returns

Promise<number>