Socket
Socket
Sign inDemoInstall

got

Package Overview
Dependencies
Maintainers
1
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

got - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

19

index.js

@@ -5,2 +5,3 @@ 'use strict';

var https = require('https');
var zlib = require('zlib');
var assign = require('object-assign');

@@ -18,3 +19,9 @@

cb = cb || function () {};
opts = opts || {};
opts.headers = assign({
'user-agent': 'https://github.com/sindresorhus/got',
'accept-encoding': 'gzip,deflate'
}, opts.headers || {});
var parsedUrl = urlLib.parse(url);

@@ -46,2 +53,8 @@ var fn = parsedUrl.protocol === 'https:' ? https : http;

if (['gzip', 'deflate'].indexOf(res.headers['content-encoding']) !== -1) {
var unzip = zlib.createUnzip();
res.pipe(unzip);
res = unzip;
}
res.setEncoding('utf8');

@@ -53,6 +66,8 @@

res.on('end', function () {
res.once('error', cb);
res.once('end', function () {
cb(null, ret);
});
}).on('error', cb);
}).once('error', cb);
};

@@ -59,0 +74,0 @@

2

package.json
{
"name": "got",
"version": "0.2.0",
"version": "0.3.0",
"description": "Simplified HTTP/HTTPS requests",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -5,8 +5,12 @@ # got [![Build Status](https://travis-ci.org/sindresorhus/got.svg?branch=master)](https://travis-ci.org/sindresorhus/got)

A nicer interface to the built-in [`http`](http://nodejs.org/api/http.html) module that also follows redirects. Use [request](https://github.com/mikeal/request) if you need more.
A nicer interface to the built-in [`http`](http://nodejs.org/api/http.html) module.
It also supports following redirects and automagically handling gzip/deflate.
Use [request](https://github.com/mikeal/request) if you need more.
## Install
```bash
```sh
$ npm install --save got

@@ -52,2 +56,2 @@ ```

[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](http://sindresorhus.com)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc