orangewise / s3-zip

Download selected files from an Amazon S3 bucket as a zip file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read properties of null (reading 'on')

AlanGreyjoy opened this issue · comments

Hello,

I am currently trying to use this package to zip files from an s3 bucket and then store them back on s3.

I am running into a problem, even just using the the sample code on the repo.

TypeError: Cannot read properties of null (reading 'on')
/s3-zip.js line 46

We have been given the requirement to use LocalStack 0.11.4

We are also passing along an s3 client as defined in aws.js

import AWS from 'aws-sdk'

AWS.config.update({
    region: config.awsConfig.region,
    accessKeyId: 'test',
    secretAccessKey: 'test',
    s3ForcePathStyle: true,
    endpoint: 'http://localhose:4566'
})

export const s3 = new AWS.S3()
import { s3 } from './aws'

const fs = require('fs')
const output = fs.createWriteStream('./test-s3-zip.zip')
const keys = [
    'file1.png',
    'file2.png',
    'file3.png'
]

const options = {
    s3: s3,
    bucket: config.awsConfig.bucket,
    debug: true
}

try{
    s3Zip.archive(options, '', keys).pipe(output)
} catch (e) {
    awsLogger('error', e)
}

Oh wow. This hasn't been updated in years... vaporware?

I haven't tested with localstack but feel free to submit a pr.