File system abstraction to work with files from various sources
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 fetchedThis 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