Skip to main content

Tar.Pack

Examples below assume this module is imported with an imports: entry under alias Tar. Kind references follow that alias — substitute your own if you import it under a different name.

Builds a tar archive from an ordered list of { path, contents } entries and emits it as a Stream<Uint8Array>. Counterpart to Tar.Extract. Pipe the output through Gzip.Encoder for a .tar.gz.


Example

- name: pack
inputs:
entries:
- path: telo.yaml
contents: "name: hello"
invoke: { kind: Tar.Pack, name: Build }
- name: compress
inputs: { input: "${{ steps.pack.result.output }}" }
invoke: { kind: Gzip.Encoder, name: Gzip }

Invocation inputs

InputTypeRequiredDescription
entriesarray of { path, contents }yesFiles to write, in order.
entries[].pathstringyesEntry path inside the archive.
entries[].contentsstringyesUTF-8 text content of the entry.

Output

FieldTypeDescription
outputStream<Uint8Array>Tar archive byte stream.