ZIP jobs
Choose createZip or startZip and understand the lifecycle shared by Local and Cloud execution.
Every Core export is a ZipJob. Choose whether you want only its finished
result or access to the job while it runs.
Which function should I use?
| Need | Use | Returns |
|---|---|---|
| Wait for a ZIP, then download it | createZip(options) | Promise<ZipResult> |
| Show progress, cancel, or drive custom UI | startZip(options) | ZipJob immediately |
createZip(options) is the one-shot form of startZip(options).done. Both
accept the same Local or Cloud options.
const result = await createZip({ files });
result.download();What is the lifecycle?
A job starts in starting, moves to processing, and finishes once:
completed— every source produced usable output;partial— output is usable, but one or more sources were skipped;failed— no usable result was produced; oraborted— this client stopped the job.
Snapshots also expose progress, output ZIPs, errors, and Cloud session metadata when those values exist.
How do I observe a job?
const job = startZip({ files });
const unsubscribe = job.subscribe(() => {
const snapshot = job.getSnapshot();
console.log(snapshot.status, snapshot.progress);
});
try {
const result = await job.done;
result.download();
} finally {
unsubscribe();
}Three members cover most custom interfaces:
getSnapshot()returns the current immutable state.subscribe(listener)runs the listener after each state change.doneresolves with a completed or partial result.
What does abort mean?
For a Local job, abort() stops browser fetching and ZIP creation. For a Cloud
job, it stops this client from polling; the server-side job can continue and be
resumed later.
What should I do with the result?
Use download() for one output or downloadAll() when the job was
split into multiple ZIPs. Local results also expose
dispose() to revoke their temporary object URLs when you no longer need them.
See the Core Reference for every option, member, result field, and error class.