vlt / docs

  • PricingBenchmarks (opens in new window)Community (opens in new window)Feedback
  • Overview
    • Overview
    • 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: pool.ts:30

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()
TypeScript
new Pool(): Pool
Returns

Pool

Methods

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

Defined in: pool.ts:61

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): Promise<void>

Defined in: pool.ts:35

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
Returns

Promise<void>

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

Defined in: pool.ts:45

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
Returns

Promise<void>

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

Defined in: pool.ts:73

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

Parameters
ParameterType
tarDataBuffer
dirstring
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