A Node.js library for creating .zip archives from files in a Google Cloud Storage bucket. Version 2.0.0 splits out the CLI tool into a separate package (zip-bucket-bin). It provides a Promise-based API with streaming support to handle large files efficiently. Alternative to manually downloading and zipping GCS files, with options to save locally, upload back to GCS, and rename files via a mapper function. Known for potential write stream timeouts (~1%) on large uploads.
npm install zip-bucketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to zip files from a GCS bucket and save the archive locally using zip-bucket.
Install zip-bucket-bin: npm install -g zip-bucket-bin
Use const zipBucket = require('zip-bucket')(storage) or const zipBucketFactory = require('zip-bucket'); const zipBucket = zipBucketFactory(storage);Implement retry logic or catch errors and retry the zip operation.
Run the script on Google Cloud Platform (e.g., Cloud Functions, Compute Engine) to avoid egress charges.
Use require('zip-bucket')(storage) instead of require('zip-bucket')Install @google-cloud/storage: npm install @google-cloud/storage
Verify the bucket name and ensure it exists in your GCP project.