Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

got

Package Overview
Dependencies
Maintainers
3
Versions
178
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.2 to 6.1.0

5

index.js

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

const isPlainObj = require('is-plain-obj');
const isRetryAllowed = require('is-retry-allowed');

@@ -258,4 +259,4 @@ function requestAsEventEmitter(opts) {

const retries = opts.retries;
opts.retries = function backoff(iter) {
if (iter > retries) {
opts.retries = function backoff(iter, err) {
if (iter > retries || !isRetryAllowed(err)) {
return 0;

@@ -262,0 +263,0 @@ }

7

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

@@ -48,7 +48,8 @@ "license": "MIT",

"dependencies": {
"create-error-class": "^3.0.0",
"duplexer3": "^0.1.4",
"create-error-class": "^3.0.0",
"get-stream": "^1.1.0",
"is-plain-obj": "^1.0.0",
"is-redirect": "^1.0.0",
"is-retry-allowed": "^1.0.0",
"is-stream": "^1.0.0",

@@ -62,3 +63,3 @@ "lowercase-keys": "^1.0.0",

"devDependencies": {
"ava": "^0.9.0",
"ava": "^0.10.0",
"coveralls": "^2.11.4",

@@ -65,0 +66,0 @@ "get-port": "^2.0.0",

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

**WARNING: Node.js 4 or higher is required for got@6 and above.** For older Node.js versions use got@5.
**WARNING: Node.js 4 or higher is required for got@6 and above.** For older Node.js versions use [got@5](https://github.com/sindresorhus/got/tree/v5.x).

@@ -124,2 +124,4 @@ ```

**Note:** `ENOTFOUND` and `ENETUNREACH` error will not be retried (see full list in [`is-retry-allowed`](https://github.com/floatdrop/is-retry-allowed/blob/master/index.js#L12) module).
Option accepts `function` with `retry` and `error` arguments. Function must return delay in milliseconds (`0` return value cancels retry).

@@ -226,2 +228,21 @@

## Form data
You can use the [`form-data`](https://www.npmjs.com/package/form-data) module to create POST request with form data:
```js
const fs = require('fs');
const got = require('got');
const FormData = require('form-data');
const form = new FormData();
form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
got.post('google.com', {
headers: form.getHeaders(),
body: form
});
```
## Unix Domain Sockets

@@ -228,0 +249,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