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

x/ayonli_jsext/lib.deno.d.ts>Deno.SeekerSync

A JavaScript extension package for building strong and modern applications.
Latest
interface Deno.SeekerSync
import { type Deno } from "https://deno.land/x/ayonli_jsext@v0.9.72/lib.deno.d.ts";
const { SeekerSync } = Deno;

An abstract interface which when implemented provides an interface to seek within an open file/resource synchronously.

Methods

seekSync(offset: number | bigint, whence: SeekMode): number

Seek sets the offset for the next readSync() or writeSync() to offset, interpreted according to whence: Start means relative to the start of the file, Current means relative to the current offset, and End means relative to the end.

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.

It returns the updated offset.