Skip to content

blacha/chunkd

Repository files navigation

@chunkd

File system abstraction to work with files from various sources

Usage

Load a chunks of data from a URL using fetch

import { fsa } from '@chunkd/fs';

const source = fsa.source(new URL('https://example.com/foo.zip'));

const firstBuffer = await source.fetch(0, 1024); // Load the first 1KB from the source
const lastBuffer = await source.fetch(-1024); // load the last 1KB from the source

const size = source.metadata?.size; // File size if metadata has been fetched

Building

This requires NodeJs >= 18

Use fnm to manage nodeJs versions

# Download the latest nodejs 
fnm use 24

# Install node deps
npm

# Build everything into /build
npm run build

# Run the unit tests
npm run test

About

Chunked file reading abstraction for S3, HTTP and files

Resources

License

Contributing

Stars

Watchers

Forks

Contributors