@chunkd/source-file
v11.0.1
Published
Load chunks of data from a file using `node:fs`
Downloads
1,288
Readme
@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