@ferrybig/cgeodata-reader
    Preparing search index...

    A file on disk as a ByteSource: each read reads just that range, on libuv's thread pool.

    Holds a plain file descriptor rather than a fs.promises FileHandle: Node.js treats a FileHandle that is garbage collected without being closed as an uncaught error, which would take a whole server down over a forgotten close(). A forgotten FileSource is closed when it's collected instead.

    Implements

    Index
    size: number

    Total size in bytes.

    name: string

    Shown in error messages about this source, e.g. a file path.

    • Opens the file at path for reading.

      Parameters

      • path: string

      Returns Promise<FileSource>

    • length bytes from offset, fewer only where the source ends. The returned bytes may be a view of the source's own memory, so a caller must not modify them.

      Parameters

      • offset: number
      • length: number

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Releases whatever the source holds open, if anything.

      Returns Promise<void>