Browse Source

Don't unzip response in browsers

This reduces the browserifed size from 471 KB to 268 KB.
http2
Kevin Martensson 9 years ago
parent
commit
f9f2807e63
  1. 2
      index.js
  2. 3
      package.json

2
index.js

@ -47,7 +47,7 @@ function requestAsEventEmitter(opts) {
return;
}
ee.emit('response', unzipResponse(res));
ee.emit('response', typeof unzipResponse === 'function' ? unzipResponse(res) : res);
}).once('error', function (err) {
ee.emit('error', new got.RequestError(err, opts));
});

3
package.json

@ -19,6 +19,9 @@
"engines": {
"node": ">=0.10.0"
},
"browser": {
"unzip-response": false
},
"scripts": {
"test": "xo && ava"
},

Loading…
Cancel
Save