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; return;
} }
ee.emit('response', unzipResponse(res)); ee.emit('response', typeof unzipResponse === 'function' ? unzipResponse(res) : res);
}).once('error', function (err) { }).once('error', function (err) {
ee.emit('error', new got.RequestError(err, opts)); ee.emit('error', new got.RequestError(err, opts));
}); });

3
package.json

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

Loading…
Cancel
Save