@cotar/builder
TypeScript icon, indicating that this package has built-in type declarations

6.0.1 • Public • Published

Cloud optimised TAR @cotar/builder

Given a .tar with a .index using HTTP range requests fetch only the portion of the tar that contains the bytes of the file.

For example @cotar/core can fetch a 1KB file from a 100GB tar file with only 1 HTTP range request and only download 1KB. Assuming the tar index is loaded into memory.

Usage

Indexes can be created using the @cotar/cli package or programmatically using the CotarIndexBuilder

import { CotarIndexBuilder } from '@cotar/builder';
import * as fs from 'fs/promises';

const fd = await fs.open('tarFile.tar', 'r');
const res = await CotarIndexBuilder.create(fd, CotarIndex.Binary);
await fs.write('tarFile.tar.index', res.buffer);
await fd.close();

Readme

Keywords

none

Package Sidebar

Install

npm i @cotar/builder

Weekly Downloads

61

Version

6.0.1

License

MIT

Unpacked Size

121 kB

Total Files

34

Last publish

Collaborators

  • blacha
  • linzds