Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

s3-zip-handler

TindinOficial578ISC2.0.0TypeScript support: included

extract a zip file provided from your AWS s3 bucket to any other place

s3, zip, unzip, unzipper, decompress, unzip-s3, s3-zip, s3-unzipper, s3-unzip

readme

S3 zip handler

S3 zip handler

What it does:

extract a zip file provided from your AWS s3 bucket to any other place, either local or back to s3 bucket where will create a new folder with the name of the .zip file

Basic usage:

We highly recommend aws-sdk-v3 usage

Start by declaring your S3 client:

import s3ZipHandler from 's3-zip-handler'
import { S3Client } from '@aws-sdk/client-s3'

const s3Client = new S3Client({
    ...your s3 settings
})

After declaring your S3 Client use the following code to:

  • Decompress back to the s3 folder: `typescript const s3Config = { s3Client, bucket: 'your-s3-bucket', key: 'your-s3-key/your-zip-file.zip' }

const {localPath, uploadedPath } = await s3ZipHandler.decompressToKeyFolderS3(s3Config)

// localPath = 'os-tmp/unzipped-xxxx/your-zip-file' // uploadedPath = 'your-s3-bucket/your-s3-key/your-zip-file'


 - **Decompress to local folder:**
```typescript
const s3Config = {
    s3Client,
    bucket: 'your-s3-bucket',
    key: 'your-s3-key/your-zip-file.zip'
} 

const { localPath } = await s3ZipHandler.decompressLocal(s3Config, 'path-to-extract')

// localPath = 'path-to-extract/your-zip-file'