tar
    Preparing search index...

    Class PackSync

    Makes an archive with no promise. add() paths and entries. The pack is the iterator of the bytes of the archive. It reads the file system only when the consumer asks for bytes, one path at a time. The entries of a directory come before the next item that the caller added.

    The pack ends when the iterator comes to the end of the queue. With compression, the iterator gives all the archive in one chunk.

    Hierarchy (View Summary)

    Implements

    • IterableIterator<Uint8Array, undefined>
    Index

    Constructors

    Properties

    codec?: Codec

    The compression of the output.

    codecOptions?: Record<string, unknown>
    cwd?: string

    The normalized form of opt.cwd.

    ended: boolean = false

    True after end().

    head?: QueueNode<
        | ReadEntrySync
        | WriteEntry
        | PackJob
        | Iterable<ReadEntrySync | WriteEntry, any, any>,
    >

    The options of WriteEntry.encode.

    maxReadSize: number
    tail?: QueueNode<
        | ReadEntrySync
        | WriteEntry
        | PackJob
        | Iterable<ReadEntrySync | WriteEntry, any, any>,
    >
    wake?: () => void
    win32: boolean

    Methods

    • Returns this

    • Add no more. The archive ends after the last item of the queue.

      Returns this

    • Report a path that does not exist, and skip it. Each other error of the stat is thrown.

      Parameters

      Returns undefined

    • True if the pack must read the exact dev and ino of the object with the bigint option: the numbers are not exact, and a wrong match loses data. That is a file with more than one link, which a wrong match makes a hard link to a different file, and with follow a directory, which a wrong match skips as a directory in itself. Each other object gets no second stat.

      Parameters

      Returns boolean

    • Returns IteratorResult<Uint8Array<ArrayBufferLike>, undefined>

    • Make the entry for a path.

      Parameters

      • job: PackJob
      • stat: CreateStats
      • type: EntryTypeName
      • linkpath: string | undefined
      • body:
            | Blob
            | Uint8Array<ArrayBufferLike>
            | ReadableStream<Uint8Array<ArrayBufferLike>>
            | AsyncIterable<Uint8Array<ArrayBufferLike>, any, any>
            | Iterable<Uint8Array<ArrayBufferLike>, any, any>
            | undefined

      Returns WriteEntry

    • The absolute form of a path that is relative to cwd.

      Parameters

      • path: string

      Returns string

    • Stop, and close the file that is open.

      Returns IteratorResult<Uint8Array<ArrayBufferLike>, undefined>