vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • clonefile
    • link-tree
    • index
    • pool
    • Reference
    • store-entry
    • store-index
    • unpack
  • Classes
  • Pool
  1. Client
  2. /
  3. API Reference
  4. /
  5. @vltpkg/tar
  6. /
  7. pool

pool

Classes

Pool

Defined in: tar/src/pool.ts:48

Unpacks tarballs into place.

Decompression runs on libuv's threadpool, so packages inflate in parallel; the files are then written synchronously on the main thread, which is measurably faster than the async writers (the libuv round trip per file costs more than the IO). VLT_TAR_SYNC switches that pairing; see the constant above.

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. How many inflate at once is capped lower and elsewhere, by UV_THREADPOOL_SIZE (4 by default).

Constructors

new Pool()
TypeScript
new Pool(): Pool
Returns

Pool

Methods

linkFromStore()
TypeScript
linkFromStore(
   storeEntry, 
   target, 
opts?): Promise<StoreLinkResult>

Defined in: tar/src/pool.ts:92

Hardlink (or copy) a global store entry into target. Resolves how, with the index, or false on a store miss. See linkFromStore.

Parameters
ParameterType
storeEntrystring
targetstring
opts?LinkFromStoreOptions
Returns

Promise<StoreLinkResult>

unpack()
TypeScript
unpack(
   tarData, 
   target, 
format?): Promise<void>

Defined in: tar/src/pool.ts:53

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

Parameters
ParameterType
tarDataBuffer
targetstring
format?TarballFormat
Returns

Promise<void>

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

Defined in: tar/src/pool.ts:68

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
ParameterTypeDefault value
filestringundefined
targetstringundefined
offsetnumber0
format?TarballFormatundefined
Returns

Promise<void>

unpackToStore()
TypeScript
unpackToStore(
   tarData, 
   dir, 
   format?): Promise<{
  index: StoreIndex;
}>

Defined in: tar/src/pool.ts:104

Explode a tarball into dir for the global store. See unpackToStoreSync.

Parameters
ParameterType
tarDataBuffer
dirstring
format?TarballFormat
Returns

Promise<{ index: StoreIndex; }>


PreviousindexNextReference

On this page

  • Classes
  • Pool

Deploy your package on vlt.io

Publish scoped and private packages, manage organizations and access, and give every developer and CI environment a consistent source for public and private JavaScript dependencies.

Publish now