streamzipper
v0.2.10
Published
On-demand ZIP streaming API client for Node.js
Downloads
853
Readme
StreamZipper
A Node.js client for the StreamZipper API - create and stream ZIP files on-demand.
Setup your account & get an API key at https://streamzipper.com/
Installation
npm i streamzipper
Usage
import StreamZipper from 'streamzipper';
const zipper = new StreamZipper('YOUR_API_KEY');
const files = [
{ url: 'https://example.com/file1.jpg', zipPath: 'images/file1.jpg' },
{ url: 'https://example.com/file2.jpg', zipPath: 'images/file2.jpg' },
];
const zip = await zipper.createZipLink({ files, zipName: 'my-archive.zip' });
console.log(zip.url);
return zip.url; // Return the URL to download the ZIP file to your client
API Reference
new StreamZipper(apiKey: string)
Creates a new StreamZipper client instance.
createZipLink(request: CreateZipLinkRequest)
Creates a new ZIP streaming job. The API endpoint is:
POST https://streamzipper.com/api/create-zip-link
Parameters
files (required): Array of files to be included in the zip. Each file must have:
zipPath
: The path within the zip file where the file will be placed. Can include directories (e.g., "some/directory/file2.jpg")url
: The URL of the file to include. Supports:- Public URLs
- Signed URLs
- S3 URLs (format:
s3://bucket-name/file-key
) - requires AWS credentials setup in dashboard
zipName (optional): Name given to the zip file when downloaded
- Default: "archive.zip"
expiresInSeconds (optional): Duration in seconds for which the returned link will be valid
- Default: 3600 (1 hour)
noExpiration (optional): If true, the link will not expire
- Note: You can always expire active links in the dashboard at https://streamzipper.com/dash