Skip to content
API Referencetarpool

@vltpkg/tar/pool

Classes

Pool

Defined in: pool.ts:19

Unpacks tarballs into place.

Unpacking runs synchronously on the main thread, which is measurably faster than the async writers (the libuv round trip per file costs more than the IO).

There is no queue here. The only limiter is the caller’s: reify caps extraction at Math.max(availableParallelism() - 1, 1) * 8 in flight (@vltpkg/graph, src/reify/index.ts). A consumer that is not reify is unbounded — add your own cap.

Constructors

new Pool()
new Pool(): Pool
Returns

Pool

Methods

unpack()
unpack(tarData, target): Promise<void>

Defined in: pool.ts:24

Provide the tardata to be unpacked, and the location where it’s to be placed. Resolves when the tarball has been extracted.

Parameters
tarData

Buffer

target

string

Returns

Promise<void>

unpackFile()
unpackFile(
file,
target,
offset): Promise<void>

Defined in: pool.ts:34

Same, reading the tarball from a file and skipping offset leading bytes, so a cache entry is unpacked without loading it into the registry client’s in-memory cache.

Parameters
file

string

target

string

offset

number = 0

Returns

Promise<void>