JavaScript
Create, observe, and download ZIP jobs in any browser application with @eazip/core.
@eazip/core is Eazip.js's framework-agnostic browser engine. It works in any
application that provides fetch and Blob.
Here is what you'll build — try it:
Loading live demo…
Install
npm install @eazip/corepnpm add @eazip/coreyarn add @eazip/corebun add @eazip/coreCreate and download a ZIP
Given a file input and a button in your interface:
<input id="files" type="file" multiple />
<button id="download">Download ZIP</button>Call createZip(...), wait for the result, then download it:
import { createZip } from '@eazip/core';
const fileInput = document.querySelector('#files');
const downloadButton = document.querySelector('#download');
downloadButton.addEventListener('click', async () => {
const result = await createZip({
files: fileInput.files,
zipName: 'export.zip',
});
result.download();
});Local is the default
Without a strategy, the ZIP is created in the browser. No account, API
key, or backend code is required.
Pass files or URLs
The files option accepts these shapes, mixed freely in one array:
| Shape | Example |
|---|---|
| Browser files | File, FileList, Blob |
| URL strings | 'https://assets.example.com/hero.png' |
| Named entries | { url, filename } or { file, filename } |
Remote URLs fetched by Local jobs must allow browser requests — see Inputs and sources.
Track progress or cancel
Use startZip(...) when your interface needs the job while it runs:
import { startZip } from '@eazip/core';
const job = startZip({
files: fileInput.files,
zipName: 'export.zip',
});
const unsubscribe = job.subscribe(() => {
const { status, progress } = job.getSnapshot();
console.log(status, progress);
});
try {
const result = await job.done;
result.download();
} finally {
unsubscribe();
}Call job.abort() from your cancel action. If an individual URL fails, Eazip
returns the other files as a partial result by default; inspect
result.errors for the skipped files.
Add it with your AI assistant
Working in Cursor, Claude Code, or another AI editor? Copy this prompt:
Add a ZIP download to this app using @eazip/core (browser-side, no backend).
1. Install @eazip/core.
2. On the download action, call createZip({ files, zipName }) — files
accepts File, FileList, Blob, URL strings, or { url, filename }
entries — then call result.download().
3. For progress or cancel, use startZip() and job.subscribe() instead.
Reference: https://eazip.io/js/docs/getting-started/javascript
Full docs for context: https://eazip.io/js/llms-full.txtNext steps
- Bigger jobs: multi-gigabyte or thousand-URL archives keep the same
call — add
strategy: 'cloud'and a public key. See When to use Eazip Cloud. - Understand
createZip,startZip, andZipJob. - Handle partial results and errors.
- Building with React? Continue with React.
- Connect your storage: Supabase, S3, and more sources.