Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auto unzip feature #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

cleverleo
Copy link

Automatically detect compression and unzipped

Copy link
Owner

@crccheck crccheck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. Thanks for the contribution. I just threw in some of my thoughts as I'm looking at this on my way out the door. Hopefully I'll remember to look at this again later when I have more time.

@@ -9,6 +9,12 @@ const index = require('./')
const pkg = require('./package.json')

const client = new AWS.Kinesis()
const zlib = require('zlib')

const gzip_head = Buffer.from([0x1f, 0x8b])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about casing these like GZIP_HEAD so they look more like global constants instead of regular variables?

@@ -28,7 +34,20 @@ program
program.args = []
return
}
const options = {}
const options = {
parser: (buffer) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this myself yet, buy my gut reaction is I wish this function was pulled out of the option parsing logic so what was left here read parser: decompressIfCompressed. That looks like a really long name but maybe you can think of a more elegant one.

@crccheck crccheck mentioned this pull request Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants