Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register β†’
Socket
Socket
Sign inDemoInstall

got

Package Overview
Dependencies
20
Maintainers
2
Versions
175
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 13.0.0 to 14.0.0

2

dist/source/as-promise/types.d.ts

@@ -6,3 +6,3 @@ /// <reference types="node" resolution-mode="require"/>

import type Request from '../core/index.js';
import type { RequestEvents } from '../core/index.js';
import { type RequestEvents } from '../core/index.js';
import type { Response } from '../core/response.js';

@@ -9,0 +9,0 @@ /**

@@ -11,40 +11,10 @@ import is from '@sindresorhus/is';

export class RequestError extends Error {
input;
code;
stack;
response;
request;
timings;
constructor(message, error, self) {
super(message);
Object.defineProperty(this, "input", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "stack", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "response", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "request", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "timings", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Error.captureStackTrace(this, this.constructor);

@@ -131,16 +101,6 @@ this.name = 'RequestError';

export class TimeoutError extends RequestError {
timings;
event;
constructor(error, timings, request) {
super(error.message, error, request);
Object.defineProperty(this, "timings", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "event", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.name = 'TimeoutError';

@@ -147,0 +107,0 @@ this.event = error.event;

@@ -6,6 +6,7 @@ /// <reference types="node" resolution-mode="require"/>

/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import { Duplex } from 'node:stream';
import type { ClientRequest } from 'node:http';
import { type ClientRequest } from 'node:http';
import type { Socket } from 'node:net';
import type { Timings } from '@szmarczak/http-timer';
import { type Timings } from '@szmarczak/http-timer';
import Options from './options.js';

@@ -12,0 +13,0 @@ import { type PlainResponse, type Response } from './response.js';

@@ -9,3 +9,3 @@ import process from 'node:process';

import is from '@sindresorhus/is';
import getStream from 'get-stream';
import { getStreamAsBuffer } from 'get-stream';
import { FormDataEncoder, isFormData as isFormDataLike } from 'form-data-encoder';

@@ -24,3 +24,2 @@ import getBodySize from './utils/get-body-size.js';

import { RequestError, ReadError, MaxRedirectsError, HTTPError, TimeoutError, UploadError, CacheError, AbortError, } from './errors.js';
const { buffer: getStreamAsBuffer } = getStream;
const supportsBrotli = is.string(process.versions.brotli);

@@ -39,2 +38,30 @@ const methodsWithoutBody = new Set(['GET', 'HEAD']);

export default class Request extends Duplex {
// @ts-expect-error - Ignoring for now.
['constructor'];
_noPipe;
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/9568
options;
response;
requestUrl;
redirectUrls;
retryCount;
_stopRetry;
_downloadedSize;
_uploadedSize;
_stopReading;
_pipedServerResponses;
_request;
_responseSize;
_bodySize;
_unproxyEvents;
_isFromCache;
_cannotHaveBody;
_triggerRead;
_cancelTimeouts;
_removeListeners;
_nativeResponse;
_flushed;
_aborted;
// We need this because `this._request` if `undefined` when using cache
_requestInitialized;
constructor(url, options, defaults) {

@@ -47,155 +74,2 @@ super({

});
// @ts-expect-error - Ignoring for now.
Object.defineProperty(this, 'constructor', {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_noPipe", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/9568
Object.defineProperty(this, "options", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "response", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "requestUrl", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "redirectUrls", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "retryCount", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_stopRetry", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_downloadedSize", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_uploadedSize", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_stopReading", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_pipedServerResponses", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_request", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_responseSize", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_bodySize", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_unproxyEvents", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_isFromCache", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_cannotHaveBody", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_triggerRead", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_cancelTimeouts", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_removeListeners", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_nativeResponse", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_flushed", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_aborted", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
// We need this because `this._request` if `undefined` when using cache
Object.defineProperty(this, "_requestInitialized", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this._downloadedSize = 0;

@@ -320,3 +194,3 @@ this._uploadedSize = 0;

// It emits post-request Parse Errors on the same instance as previous request. WTF.
// Therefore we need to check if it has been destroyed as well.
// Therefore, we need to check if it has been destroyed as well.
//

@@ -638,72 +512,75 @@ // Furthermore, Node.js 16 `response.destroy()` doesn't immediately destroy the socket,

}
if (options.followRedirect && response.headers.location && redirectCodes.has(statusCode)) {
if (response.headers.location && redirectCodes.has(statusCode)) {
// We're being redirected, we don't care about the response.
// It'd be best to abort the request, but we can't because
// we would have to sacrifice the TCP connection. We don't want that.
response.resume();
this._cancelTimeouts();
this._unproxyEvents();
if (this.redirectUrls.length >= options.maxRedirects) {
this._beforeError(new MaxRedirectsError(this));
return;
}
this._request = undefined;
const updatedOptions = new Options(undefined, undefined, this.options);
const serverRequestedGet = statusCode === 303 && updatedOptions.method !== 'GET' && updatedOptions.method !== 'HEAD';
const canRewrite = statusCode !== 307 && statusCode !== 308;
const userRequestedGet = updatedOptions.methodRewriting && canRewrite;
if (serverRequestedGet || userRequestedGet) {
updatedOptions.method = 'GET';
updatedOptions.body = undefined;
updatedOptions.json = undefined;
updatedOptions.form = undefined;
delete updatedOptions.headers['content-length'];
}
try {
// We need this in order to support UTF-8
const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString();
const redirectUrl = new URL(redirectBuffer, url);
if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) {
this._beforeError(new RequestError('Cannot redirect to UNIX socket', {}, this));
const shouldFollow = typeof options.followRedirect === 'function' ? options.followRedirect(typedResponse) : options.followRedirect;
if (shouldFollow) {
response.resume();
this._cancelTimeouts();
this._unproxyEvents();
if (this.redirectUrls.length >= options.maxRedirects) {
this._beforeError(new MaxRedirectsError(this));
return;
}
// Redirecting to a different site, clear sensitive data.
if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) {
if ('host' in updatedOptions.headers) {
delete updatedOptions.headers.host;
this._request = undefined;
const updatedOptions = new Options(undefined, undefined, this.options);
const serverRequestedGet = statusCode === 303 && updatedOptions.method !== 'GET' && updatedOptions.method !== 'HEAD';
const canRewrite = statusCode !== 307 && statusCode !== 308;
const userRequestedGet = updatedOptions.methodRewriting && canRewrite;
if (serverRequestedGet || userRequestedGet) {
updatedOptions.method = 'GET';
updatedOptions.body = undefined;
updatedOptions.json = undefined;
updatedOptions.form = undefined;
delete updatedOptions.headers['content-length'];
}
try {
// We need this in order to support UTF-8
const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString();
const redirectUrl = new URL(redirectBuffer, url);
if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) {
this._beforeError(new RequestError('Cannot redirect to UNIX socket', {}, this));
return;
}
if ('cookie' in updatedOptions.headers) {
delete updatedOptions.headers.cookie;
// Redirecting to a different site, clear sensitive data.
if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) {
if ('host' in updatedOptions.headers) {
delete updatedOptions.headers.host;
}
if ('cookie' in updatedOptions.headers) {
delete updatedOptions.headers.cookie;
}
if ('authorization' in updatedOptions.headers) {
delete updatedOptions.headers.authorization;
}
if (updatedOptions.username || updatedOptions.password) {
updatedOptions.username = '';
updatedOptions.password = '';
}
}
if ('authorization' in updatedOptions.headers) {
delete updatedOptions.headers.authorization;
else {
redirectUrl.username = updatedOptions.username;
redirectUrl.password = updatedOptions.password;
}
if (updatedOptions.username || updatedOptions.password) {
updatedOptions.username = '';
updatedOptions.password = '';
this.redirectUrls.push(redirectUrl);
updatedOptions.prefixUrl = '';
updatedOptions.url = redirectUrl;
for (const hook of updatedOptions.hooks.beforeRedirect) {
// eslint-disable-next-line no-await-in-loop
await hook(updatedOptions, typedResponse);
}
this.emit('redirect', updatedOptions, typedResponse);
this.options = updatedOptions;
await this._makeRequest();
}
else {
redirectUrl.username = updatedOptions.username;
redirectUrl.password = updatedOptions.password;
catch (error) {
this._beforeError(error);
return;
}
this.redirectUrls.push(redirectUrl);
updatedOptions.prefixUrl = '';
updatedOptions.url = redirectUrl;
for (const hook of updatedOptions.hooks.beforeRedirect) {
// eslint-disable-next-line no-await-in-loop
await hook(updatedOptions, typedResponse);
}
this.emit('redirect', updatedOptions, typedResponse);
this.options = updatedOptions;
await this._makeRequest();
}
catch (error) {
this._beforeError(error);
return;
}
return;
}
// `HTTPError`s always have `error.response.body` defined.
// Therefore we cannot retry if `options.throwHttpErrors` is false.
// Therefore, we cannot retry if `options.throwHttpErrors` is false.
// On the last retry, if `options.throwHttpErrors` is false, we would need to return the body,

@@ -710,0 +587,0 @@ // but that wouldn't be possible since the body would be already read in `error.response.body`.

@@ -11,13 +11,10 @@ /// <reference types="node" resolution-mode="require"/>

import type { Buffer } from 'node:buffer';
import { checkServerIdentity } from 'node:tls';
import http from 'node:http';
import https from 'node:https';
import { checkServerIdentity, type SecureContextOptions, type DetailedPeerCertificate } from 'node:tls';
import https, { type RequestOptions as HttpsRequestOptions, type Agent as HttpsAgent } from 'node:https';
import http, { type Agent as HttpAgent, type ClientRequest } from 'node:http';
import type { Readable } from 'node:stream';
import type { Socket } from 'node:net';
import type { SecureContextOptions, DetailedPeerCertificate } from 'node:tls';
import type { Agent as HttpAgent, ClientRequest } from 'node:http';
import type { RequestOptions as HttpsRequestOptions, Agent as HttpsAgent } from 'node:https';
import CacheableLookup from 'cacheable-lookup';
import http2wrapper, { type ClientHttp2Session } from 'http2-wrapper';
import type { FormDataLike } from 'form-data-encoder';
import { type FormDataLike } from 'form-data-encoder';
import type { StorageAdapter } from 'cacheable-request';

@@ -845,4 +842,6 @@ import type ResponseLike from 'responselike';

/**
Defines if redirect responses should be followed automatically.
Whether redirect responses should be followed automatically.
Optionally, pass a function to dynamically decide based on the response object.
Note that if a `303` is sent by the server in response to any request type (`POST`, `DELETE`, etc.), Got will automatically request the resource pointed to in the location header via `GET`.

@@ -853,4 +852,4 @@ This is in accordance with [the spec](https://tools.ietf.org/html/rfc7231#section-6.4.4). You can optionally turn on this behavior also for other redirect codes - see `methodRewriting`.

*/
get followRedirect(): boolean;
set followRedirect(value: boolean);
get followRedirect(): boolean | ((response: PlainResponse) => boolean);
set followRedirect(value: boolean | ((response: PlainResponse) => boolean));
get followRedirects(): unknown;

@@ -1141,2 +1140,3 @@ set followRedirects(_value: unknown);

json: unknown;
followRedirect: boolean | ((response: PlainResponse) => boolean);
retry: Partial<RetryOptions>;

@@ -1165,3 +1165,2 @@ agent: Agents;

hooks: Hooks;
followRedirect: boolean;
maxRedirects: number;

@@ -1217,3 +1216,3 @@ cache: string | boolean | StorageAdapter | undefined;

family: DnsLookupIpVersion;
agent: false | Agents | http.Agent | undefined;
agent: false | http.Agent | Agents | undefined;
setHost: boolean;

@@ -1242,2 +1241,6 @@ method: Method;

joinDuplicateHeaders?: boolean | undefined;
ALPNCallback?: ((arg: {
servername: string;
protocols: string[];
}) => string | undefined) | undefined;
clientCertEngine?: string | undefined;

@@ -1244,0 +1247,0 @@ privateKeyEngine?: string | undefined;

@@ -5,4 +5,4 @@ import process from 'node:process';

// DO NOT use destructuring for `https.request` and `http.request` as it's not compatible with `nock`.
import https from 'node:https';
import http from 'node:http';
import https from 'node:https';
import is, { assert } from '@sindresorhus/is';

@@ -299,27 +299,7 @@ import lowercaseKeys from 'lowercase-keys';

export default class Options {
_unixOptions;
_internals;
_merging;
_init;
constructor(input, options, defaults) {
Object.defineProperty(this, "_unixOptions", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_internals", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_merging", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "_init", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
assert.any([is.string, is.urlInstance, is.object, is.undefined], input);

@@ -1005,4 +985,6 @@ assert.any([is.object, is.undefined], options);

/**
Defines if redirect responses should be followed automatically.
Whether redirect responses should be followed automatically.
Optionally, pass a function to dynamically decide based on the response object.
Note that if a `303` is sent by the server in response to any request type (`POST`, `DELETE`, etc.), Got will automatically request the resource pointed to in the location header via `GET`.

@@ -1017,3 +999,3 @@ This is in accordance with [the spec](https://tools.ietf.org/html/rfc7231#section-6.4.4). You can optionally turn on this behavior also for other redirect codes - see `methodRewriting`.

set followRedirect(value) {
assert.boolean(value);
assert.any([is.boolean, is.function_], value);
this._internals.followRedirect = value;

@@ -1020,0 +1002,0 @@ }

@@ -9,3 +9,3 @@ export default function parseLinkHeader(link) {

// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
if (trimmedUriReference[0] !== '<' || trimmedUriReference[trimmedUriReference.length - 1] !== '>') {
if (trimmedUriReference[0] !== '<' || trimmedUriReference.at(-1) !== '>') {
throw new Error(`Invalid format of the Link header reference: ${trimmedUriReference}`);

@@ -12,0 +12,0 @@ }

import { RequestError } from './errors.js';
export const isResponseOk = (response) => {
const { statusCode } = response;
const limitStatusCode = response.request.options.followRedirect ? 299 : 399;
const { followRedirect } = response.request.options;
const shouldFollow = typeof followRedirect === 'function' ? followRedirect(response) : followRedirect;
const limitStatusCode = shouldFollow ? 299 : 399;
return (statusCode >= 200 && statusCode <= limitStatusCode) || statusCode === 304;

@@ -6,0 +8,0 @@ };

@@ -0,1 +1,2 @@

/// <reference types="node" resolution-mode="require"/>
import type { ClientRequest } from 'node:http';

@@ -2,0 +3,0 @@ declare const reentry: unique symbol;

@@ -6,16 +6,7 @@ import net from 'node:net';

export class TimeoutError extends Error {
event;
code;
constructor(threshold, event) {
super(`Timeout awaiting '${event}' for ${threshold}ms`);
Object.defineProperty(this, "event", {
enumerable: true,
configurable: true,
writable: true,
value: event
});
Object.defineProperty(this, "code", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.event = event;
this.name = 'TimeoutError';

@@ -22,0 +13,0 @@ this.code = 'ETIMEDOUT';

/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import type { Writable, Readable } from 'node:stream';

@@ -3,0 +4,0 @@ import type { ClientRequest } from 'node:http';

export default class WeakableMap {
weakMap;
map;
constructor() {
Object.defineProperty(this, "weakMap", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
Object.defineProperty(this, "map", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.weakMap = new WeakMap();

@@ -16,0 +6,0 @@ this.map = new Map();

@@ -10,2 +10,3 @@ import create from './create.js';

export default got;
// TODO: Remove this in the next major version.
export { got };

@@ -12,0 +13,0 @@ export { default as Options } from './core/options.js';

@@ -7,3 +7,3 @@ /// <reference types="node" resolution-mode="require"/>

import type Options from './core/options.js';
import type { PaginationOptions, OptionsInit } from './core/options.js';
import { type PaginationOptions, type OptionsInit } from './core/options.js';
import type Request from './core/index.js';

@@ -10,0 +10,0 @@ type Except<ObjectType, KeysType extends keyof ObjectType> = Pick<ObjectType, Exclude<keyof ObjectType, KeysType>>;

{
"name": "got",
"version": "13.0.0",
"version": "14.0.0",
"description": "Human-friendly and powerful HTTP request library for Node.js",

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

},
"sideEffects": false,
"engines": {
"node": ">=16"
"node": ">=20"
},
"scripts": {
"test": "xo && tsc --noEmit && ava",
"test": "xo && tsc --noEmit && NODE_OPTIONS='--import=tsx/esm' ava",
"release": "np",

@@ -51,12 +52,12 @@ "build": "del-cli dist && tsc",

"dependencies": {
"@sindresorhus/is": "^5.2.0",
"@sindresorhus/is": "^6.1.0",
"@szmarczak/http-timer": "^5.0.1",
"cacheable-lookup": "^7.0.0",
"cacheable-request": "^10.2.8",
"cacheable-request": "^10.2.14",
"decompress-response": "^6.0.0",
"form-data-encoder": "^2.1.2",
"get-stream": "^6.0.1",
"http2-wrapper": "^2.1.10",
"form-data-encoder": "^4.0.2",
"get-stream": "^8.0.1",
"http2-wrapper": "^2.2.1",
"lowercase-keys": "^3.0.0",
"p-cancelable": "^3.0.0",
"p-cancelable": "^4.0.1",
"responselike": "^3.0.0"

@@ -66,16 +67,14 @@ },

"@hapi/bourne": "^3.0.0",
"@sindresorhus/tsconfig": "^3.0.1",
"@sinonjs/fake-timers": "^10.0.2",
"@types/benchmark": "^2.1.2",
"@types/express": "^4.17.17",
"@types/node": "^18.14.5",
"@types/pem": "^1.9.6",
"@types/pify": "^5.0.1",
"@types/readable-stream": "^2.3.13",
"@types/request": "^2.48.8",
"@types/sinon": "^10.0.11",
"@types/sinonjs__fake-timers": "^8.1.1",
"@types/tough-cookie": "^4.0.1",
"ava": "^5.2.0",
"axios": "^0.27.2",
"@sindresorhus/tsconfig": "^5.0.0",
"@sinonjs/fake-timers": "^11.2.2",
"@types/benchmark": "^2.1.5",
"@types/express": "^4.17.21",
"@types/node": "^20.10.0",
"@types/pem": "^1.14.4",
"@types/readable-stream": "^4.0.9",
"@types/request": "^2.48.12",
"@types/sinon": "^17.0.2",
"@types/sinonjs__fake-timers": "^8.1.5",
"ava": "^5.3.1",
"axios": "^1.6.2",
"benchmark": "^2.1.4",

@@ -86,27 +85,26 @@ "bluebird": "^3.7.2",

"create-test-server": "^3.0.1",
"del-cli": "^5.0.0",
"delay": "^5.0.0",
"express": "^4.17.3",
"del-cli": "^5.1.0",
"delay": "^6.0.0",
"express": "^4.18.2",
"form-data": "^4.0.0",
"formdata-node": "^5.0.0",
"nock": "^13.3.0",
"node-fetch": "^3.2.3",
"np": "^7.6.0",
"formdata-node": "^6.0.3",
"nock": "^13.4.0",
"node-fetch": "^3.3.2",
"np": "^9.0.0",
"nyc": "^15.1.0",
"p-event": "^5.0.1",
"pem": "^1.14.6",
"pify": "^6.0.0",
"readable-stream": "^4.2.0",
"p-event": "^6.0.0",
"pem": "^1.14.8",
"pify": "^6.1.0",
"readable-stream": "^4.4.2",
"request": "^2.88.2",
"sinon": "^15.0.1",
"sinon": "^17.0.1",
"slow-stream": "0.0.4",
"tempy": "^3.0.0",
"tempy": "^3.1.0",
"then-busboy": "^5.2.1",
"tough-cookie": "4.1.2",
"ts-node": "^10.8.2",
"type-fest": "^3.6.1",
"typescript": "^5.0.4",
"xo": "^0.54.2"
"tough-cookie": "^4.1.3",
"tsx": "^4.6.0",
"type-fest": "^4.8.2",
"typescript": "^5.3.2",
"xo": "^0.56.0"
},
"sideEffects": false,
"ava": {

@@ -120,5 +118,3 @@ "files": [

},
"nodeArguments": [
"--loader=ts-node/esm"
]
"workerThreads": false
},

@@ -156,3 +152,4 @@ "nyc": {

"no-lone-blocks": "off",
"unicorn/no-await-expression-member": "off"
"unicorn/no-await-expression-member": "off",
"unicorn/prefer-event-target": "off"
}

@@ -159,0 +156,0 @@ },

@@ -83,3 +83,3 @@ <div align="center">

For browser usage, we recommend [Ky](https://github.com/sindresorhus/ky) by the same people.
**You probably want [Ky](https://github.com/sindresorhus/ky) instead, by the same people. It's smaller, works in the browser too, and is more stable since it's built upon [`Fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).**

@@ -96,3 +96,3 @@ ---

**Warning:** This package is native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and no longer provides a CommonJS export. If your project uses CommonJS, you will have to [convert to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) or use the [dynamic `import()`](https://v8.dev/features/dynamic-import) function. Please don't open issues for questions regarding CommonJS / ESM.
**Warning:** This package is native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and no longer provides a CommonJS export. If your project uses CommonJS, you will have to [convert to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). Please don't open issues for questions regarding CommonJS / ESM.

@@ -129,3 +129,3 @@ **Got v11 is no longer maintained and we will not accept any backport requests.**

- [Used by 8K+ packages and 4M+ repos](https://github.com/sindresorhus/got/network/dependents)
- [Used by 10K+ packages and 5M+ repos](https://github.com/sindresorhus/got/network/dependents)
- [Actively maintained](https://github.com/sindresorhus/got/graphs/contributors)

@@ -193,7 +193,2 @@ - [Trusted by many companies](#widely-used)

### Legacy
- [travis-got](https://github.com/samverschueren/travis-got) - Got convenience wrapper to interact with the Travis API
- [graphql-got](https://github.com/kevva/graphql-got) - Got convenience wrapper to interact with GraphQL
## Comparison

@@ -400,10 +395,2 @@

###### Former
- [Vsevolod Strukchinsky](https://github.com/floatdrop)
- [Alexander Tesfamichael](https://github.com/alextes)
- [Brandon Smith](https://github.com/brandon93s)
- [Luke Childs](https://github.com/lukechilds)
- [Giovanni Minotti](https://github.com/Giotino)
<a name="widely-used"></a>

@@ -527,7 +514,1 @@ ## These amazing companies are using Got

> β€” <a href="https://github.com/mnmkng">Ondra Urban</a>
## For enterprise
Available as part of the Tidelift Subscription.
The maintainers of `got` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-got?utm_source=npm-got&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc