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

x/deno/cli/js/lib.deno_runtime.d.ts>__io.Seeker

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface __io.Seeker
import { type __io } from "https://deno.land/x/deno@v0.30.0/cli/js/lib.deno_runtime.d.ts";
const { Seeker } = __io;

Methods

seek(offset: number, whence: SeekMode): Promise<void>

Seek sets the offset for the next read() or write() to offset, interpreted according to whence: SeekStart means relative to the start of the file, SeekCurrent means relative to the current offset, and SeekEnd means relative to the end. Seek returns the new offset relative to the start of the file and an error, if any.

Seeking to an offset before the start of the file is an error. Seeking to any positive offset is legal, but the behavior of subsequent I/O operations on the underlying object is implementation-dependent.