Socket
Socket
Sign inDemoInstall

got

Package Overview
Dependencies
Maintainers
3
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 6.0.0-rc1 to 6.0.0

10

index.js

@@ -51,10 +51,10 @@ 'use strict';

// do not write ee.bind(...) instead of function - it will break gzip in Node.js 0.10
setImmediate(() =>
ee.emit('response', typeof unzipResponse === 'function' ? unzipResponse(res) : res)
);
setImmediate(() => {
ee.emit('response', typeof unzipResponse === 'function' && req.method !== 'HEAD' ? unzipResponse(res) : res);
});
});
req.once('error', err => {
const backoff = opts.retries(++retryCount);
const backoff = opts.retries(++retryCount, err);
if (backoff) {

@@ -61,0 +61,0 @@ setTimeout(get, backoff, opts);

{
"name": "got",
"version": "6.0.0-rc1",
"version": "6.0.0",
"description": "Simplified HTTP/HTTPS requests",

@@ -61,7 +61,7 @@ "license": "MIT",

"devDependencies": {
"ava": "^0.7.0",
"ava": "^0.9.0",
"coveralls": "^2.11.4",
"get-port": "^2.0.0",
"into-stream": "^2.0.0",
"nyc": "^4.0.1",
"nyc": "^5.0.1",
"pem": "^1.4.4",

@@ -73,10 +73,4 @@ "pify": "^2.3.0",

"xo": {
"esnext": true,
"ignores": [
"test/**"
],
"rules": {
"prefer-reflect": 1
}
"esnext": true
}
}

@@ -22,2 +22,4 @@ <h1 align="center">

**WARNING: Node.JS 4.x or higher required for got@6.0.0 and above.** For older Node.JS versions use got@5.
```

@@ -75,3 +77,3 @@ $ npm install --save got

Type: `string`, `Buffer`, `ReadableStream`, `Object`
Type: `string`, `buffer`, `readableStream`, `object`

@@ -123,3 +125,3 @@ *This is mutually exclusive with stream mode.*

Option accepts `function` with `retry` argument that must return delay in milliseconds (`0` return value cancels retry).
Option accepts `function` with `retry` and `error` arguments. Function must return delay in milliseconds (`0` return value cancels retry).

@@ -135,2 +137,9 @@

__Tip__: You can use `request` event to abort request:
```js
got.stream('github.com')
.on('request', req => setTimeout(() => req.abort(), 50));
```
##### .on('response', response)

@@ -148,3 +157,2 @@

#### got.get(url, [options], [callback])

@@ -254,2 +262,3 @@ #### got.post(url, [options], [callback])

- [gh-got](https://github.com/sindresorhus/gh-got) - Convenience wrapper for interacting with the GitHub API
- [travis-got](https://github.com/samverschueren/travis-got) - Convenience wrapper for interacting with the Travis API

@@ -256,0 +265,0 @@

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