-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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]) |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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.
Automatically detect compression and unzipped