@chunkd/source-file
TypeScript icon, indicating that this package has built-in type declarations

11.0.1 • Public • Published

@chunkd/source-file

Load chunks of data from a file using node:fs

Usage

import { pathToFileURL } from 'node:path';
import { SourceFile } from '@chunkd/source-file';

const source = new SourceFile(pathToFileURL('./cog.tif'));

// Read in the first 1KB of data
await source.fetch(0, 1024);

// Read the last 1KB of data
await source.fetch(-1024);

Advanced Usage

For caching, block alignment and fetch grouping see @chunkd/middleware and @chunkd/fs

/@chunkd/source-file/

    Package Sidebar

    Install

    npm i @chunkd/source-file

    Weekly Downloads

    345

    Version

    11.0.1

    License

    MIT

    Unpacked Size

    14.4 kB

    Total Files

    10

    Last publish

    Collaborators

    • blacha