got 12.5.3 → 12.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/source/core/calculate-retry-delay.d.ts +1 -1
- package/dist/source/core/errors.d.ts +1 -1
- package/dist/source/core/index.d.ts +7 -7
- package/dist/source/core/index.js +1 -1
- package/dist/source/core/options.d.ts +50 -46
- package/dist/source/core/options.js +0 -1
- package/dist/source/core/response.d.ts +2 -2
- package/dist/source/core/timed-out.d.ts +3 -3
- package/dist/source/core/utils/is-form-data.d.ts +1 -1
- package/dist/source/core/utils/options-to-url.d.ts +1 -1
- package/dist/source/core/utils/unhandle.d.ts +4 -4
- package/dist/source/core/utils/url-to-options.d.ts +1 -1
- package/dist/source/types.d.ts +20 -20
- package/package.json +13 -14
- package/readme.md +35 -78
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RetryFunction } from './options.js';
|
|
2
|
-
|
|
2
|
+
type Returns<T extends (...args: any) => unknown, V> = (...args: Parameters<T>) => V;
|
|
3
3
|
declare const calculateRetryDelay: Returns<RetryFunction, number>;
|
|
4
4
|
export default calculateRetryDelay;
|
|
@@ -4,7 +4,7 @@ import type Options from './options.js';
|
|
|
4
4
|
import type { TimeoutError as TimedOutTimeoutError } from './timed-out.js';
|
|
5
5
|
import type { PlainResponse, Response } from './response.js';
|
|
6
6
|
import type Request from './index.js';
|
|
7
|
-
|
|
7
|
+
type Error = NodeJS.ErrnoException;
|
|
8
8
|
/**
|
|
9
9
|
An error to be thrown when a request fails.
|
|
10
10
|
Contains a `code` property with error class code, like `ECONNREFUSED`.
|
|
@@ -11,13 +11,13 @@ import type { Timings } from '@szmarczak/http-timer';
|
|
|
11
11
|
import Options from './options.js';
|
|
12
12
|
import { type PlainResponse, type Response } from './response.js';
|
|
13
13
|
import { RequestError } from './errors.js';
|
|
14
|
-
|
|
15
|
-
export
|
|
14
|
+
type Error = NodeJS.ErrnoException;
|
|
15
|
+
export type Progress = {
|
|
16
16
|
percent: number;
|
|
17
17
|
transferred: number;
|
|
18
18
|
total?: number;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type GotEventFunction<T> =
|
|
21
21
|
/**
|
|
22
22
|
`request` event to get the request object of the request.
|
|
23
23
|
|
|
@@ -78,14 +78,14 @@ When this event is emitted, you should reset the stream you were writing to and
|
|
|
78
78
|
See `got.options.retry` for more information.
|
|
79
79
|
*/
|
|
80
80
|
& ((name: 'retry', listener: (retryCount: number, error: RequestError) => void) => T);
|
|
81
|
-
export
|
|
81
|
+
export type RequestEvents<T> = {
|
|
82
82
|
on: GotEventFunction<T>;
|
|
83
83
|
once: GotEventFunction<T>;
|
|
84
84
|
off: GotEventFunction<T>;
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
type UrlType = ConstructorParameters<typeof Options>[0];
|
|
87
|
+
type OptionsType = ConstructorParameters<typeof Options>[1];
|
|
88
|
+
type DefaultsType = ConstructorParameters<typeof Options>[2];
|
|
89
89
|
export default class Request extends Duplex implements RequestEvents<Request> {
|
|
90
90
|
['constructor']: typeof Request;
|
|
91
91
|
_noPipe?: boolean;
|
|
@@ -575,7 +575,7 @@ export default class Request extends Duplex {
|
|
|
575
575
|
}
|
|
576
576
|
const statusCode = response.statusCode;
|
|
577
577
|
const typedResponse = response;
|
|
578
|
-
typedResponse.statusMessage = typedResponse.statusMessage
|
|
578
|
+
typedResponse.statusMessage = typedResponse.statusMessage ?? http.STATUS_CODES[statusCode];
|
|
579
579
|
typedResponse.url = options.url.toString();
|
|
580
580
|
typedResponse.requestUrl = this.requestUrl;
|
|
581
581
|
typedResponse.redirectUrls = this.redirectUrls;
|
|
@@ -27,39 +27,39 @@ import type { CancelableRequest } from '../as-promise/types.js';
|
|
|
27
27
|
import type { PlainResponse, Response } from './response.js';
|
|
28
28
|
import type { RequestError } from './errors.js';
|
|
29
29
|
import type { Delays } from './timed-out.js';
|
|
30
|
-
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
export
|
|
30
|
+
type Promisable<T> = T | Promise<T>;
|
|
31
|
+
export type DnsLookupIpVersion = undefined | 4 | 6;
|
|
32
|
+
type Except<ObjectType, KeysType extends keyof ObjectType> = Pick<ObjectType, Exclude<keyof ObjectType, KeysType>>;
|
|
33
|
+
export type NativeRequestOptions = HttpsRequestOptions & CacheOptions & {
|
|
34
34
|
checkServerIdentity?: CheckServerIdentityFunction;
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export
|
|
39
|
-
export
|
|
36
|
+
type AcceptableResponse = IncomingMessageWithTimings | ResponseLike;
|
|
37
|
+
type AcceptableRequestResult = Promisable<AcceptableResponse | ClientRequest> | undefined;
|
|
38
|
+
export type RequestFunction = (url: URL, options: NativeRequestOptions, callback?: (response: AcceptableResponse) => void) => AcceptableRequestResult;
|
|
39
|
+
export type Agents = {
|
|
40
40
|
http?: HttpAgent | false;
|
|
41
41
|
https?: HttpsAgent | false;
|
|
42
42
|
http2?: unknown | false;
|
|
43
43
|
};
|
|
44
|
-
export
|
|
45
|
-
export
|
|
44
|
+
export type Headers = Record<string, string | string[] | undefined>;
|
|
45
|
+
export type ToughCookieJar = {
|
|
46
46
|
getCookieString: ((currentUrl: string, options: Record<string, unknown>, cb: (error: Error | null, cookies: string) => void) => void) & ((url: string, callback: (error: Error | null, cookieHeader: string) => void) => void);
|
|
47
47
|
setCookie: ((cookieOrString: unknown, currentUrl: string, options: Record<string, unknown>, cb: (error: Error | null, cookie: unknown) => void) => void) & ((rawCookie: string, url: string, callback: (error: Error | null, result: unknown) => void) => void);
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type PromiseCookieJar = {
|
|
50
50
|
getCookieString: (url: string) => Promise<string>;
|
|
51
51
|
setCookie: (rawCookie: string, url: string) => Promise<unknown>;
|
|
52
52
|
};
|
|
53
|
-
export
|
|
54
|
-
export
|
|
55
|
-
export
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
export
|
|
53
|
+
export type InitHook = (init: OptionsInit, self: Options) => void;
|
|
54
|
+
export type BeforeRequestHook = (options: Options) => Promisable<void | Response | ResponseLike>;
|
|
55
|
+
export type BeforeRedirectHook = (updatedOptions: Options, plainResponse: PlainResponse) => Promisable<void>;
|
|
56
|
+
export type BeforeErrorHook = (error: RequestError) => Promisable<RequestError>;
|
|
57
|
+
export type BeforeRetryHook = (error: RequestError, retryCount: number) => Promisable<void>;
|
|
58
|
+
export type AfterResponseHook<ResponseType = unknown> = (response: Response<ResponseType>, retryWithMergedOptions: (options: OptionsInit) => never) => Promisable<Response | CancelableRequest<Response>>;
|
|
59
59
|
/**
|
|
60
60
|
All available hooks of Got.
|
|
61
61
|
*/
|
|
62
|
-
export
|
|
62
|
+
export type Hooks = {
|
|
63
63
|
/**
|
|
64
64
|
Called with the plain request options, right before their normalization.
|
|
65
65
|
|
|
@@ -328,20 +328,20 @@ export declare type Hooks = {
|
|
|
328
328
|
*/
|
|
329
329
|
afterResponse: AfterResponseHook[];
|
|
330
330
|
};
|
|
331
|
-
export
|
|
332
|
-
export
|
|
331
|
+
export type ParseJsonFunction = (text: string) => unknown;
|
|
332
|
+
export type StringifyJsonFunction = (object: unknown) => string;
|
|
333
333
|
/**
|
|
334
334
|
All available HTTP request methods provided by Got.
|
|
335
335
|
*/
|
|
336
|
-
export
|
|
337
|
-
export
|
|
336
|
+
export type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'HEAD' | 'DELETE' | 'OPTIONS' | 'TRACE' | 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete' | 'options' | 'trace';
|
|
337
|
+
export type RetryObject = {
|
|
338
338
|
attemptCount: number;
|
|
339
339
|
retryOptions: RetryOptions;
|
|
340
340
|
error: RequestError;
|
|
341
341
|
computedValue: number;
|
|
342
342
|
retryAfter?: number;
|
|
343
343
|
};
|
|
344
|
-
export
|
|
344
|
+
export type RetryFunction = (retryObject: RetryObject) => Promisable<number>;
|
|
345
345
|
/**
|
|
346
346
|
An object representing `limit`, `calculateDelay`, `methods`, `statusCodes`, `maxRetryAfter` and `errorCodes` fields for maximum retry count, retry handler, allowed methods, allowed status codes, maximum [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time and allowed error codes.
|
|
347
347
|
|
|
@@ -364,7 +364,7 @@ __Note:__ Got does not retry on `POST` by default.
|
|
|
364
364
|
__Note:__ If `maxRetryAfter` is set to `undefined`, it will use `options.timeout`.
|
|
365
365
|
__Note:__ If [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header is greater than `maxRetryAfter`, it will cancel the request.
|
|
366
366
|
*/
|
|
367
|
-
export
|
|
367
|
+
export type RetryOptions = {
|
|
368
368
|
limit: number;
|
|
369
369
|
methods: Method[];
|
|
370
370
|
statusCodes: number[];
|
|
@@ -374,20 +374,20 @@ export declare type RetryOptions = {
|
|
|
374
374
|
noise: number;
|
|
375
375
|
maxRetryAfter?: number;
|
|
376
376
|
};
|
|
377
|
-
export
|
|
378
|
-
export
|
|
379
|
-
export
|
|
377
|
+
export type CreateConnectionFunction = (options: NativeRequestOptions, oncreate: (error: NodeJS.ErrnoException, socket: Socket) => void) => Socket;
|
|
378
|
+
export type CheckServerIdentityFunction = (hostname: string, certificate: DetailedPeerCertificate) => NodeJS.ErrnoException | void;
|
|
379
|
+
export type CacheOptions = {
|
|
380
380
|
shared?: boolean;
|
|
381
381
|
cacheHeuristic?: number;
|
|
382
382
|
immutableMinTimeToLive?: number;
|
|
383
383
|
ignoreCargoCult?: boolean;
|
|
384
384
|
};
|
|
385
|
-
|
|
385
|
+
type PfxObject = {
|
|
386
386
|
buffer: string | Buffer;
|
|
387
387
|
passphrase?: string | undefined;
|
|
388
388
|
};
|
|
389
|
-
|
|
390
|
-
export
|
|
389
|
+
type PfxType = string | Buffer | Array<string | Buffer | PfxObject> | undefined;
|
|
390
|
+
export type HttpsOptions = {
|
|
391
391
|
alpnProtocols?: string[];
|
|
392
392
|
rejectUnauthorized?: NativeRequestOptions['rejectUnauthorized'];
|
|
393
393
|
checkServerIdentity?: CheckServerIdentityFunction;
|
|
@@ -439,12 +439,12 @@ export declare type HttpsOptions = {
|
|
|
439
439
|
ecdhCurve?: SecureContextOptions['ecdhCurve'];
|
|
440
440
|
certificateRevocationLists?: SecureContextOptions['crl'];
|
|
441
441
|
};
|
|
442
|
-
export
|
|
442
|
+
export type PaginateData<BodyType, ElementType> = {
|
|
443
443
|
response: Response<BodyType>;
|
|
444
444
|
currentItems: ElementType[];
|
|
445
445
|
allItems: ElementType[];
|
|
446
446
|
};
|
|
447
|
-
export
|
|
447
|
+
export type FilterData<ElementType> = {
|
|
448
448
|
item: ElementType;
|
|
449
449
|
currentItems: ElementType[];
|
|
450
450
|
allItems: ElementType[];
|
|
@@ -452,7 +452,7 @@ export declare type FilterData<ElementType> = {
|
|
|
452
452
|
/**
|
|
453
453
|
All options accepted by `got.paginate()`.
|
|
454
454
|
*/
|
|
455
|
-
export
|
|
455
|
+
export type PaginationOptions<ElementType, BodyType> = {
|
|
456
456
|
/**
|
|
457
457
|
A function that transform [`Response`](#response) into an array of items.
|
|
458
458
|
This is where you should do the parsing.
|
|
@@ -551,17 +551,17 @@ export declare type PaginationOptions<ElementType, BodyType> = {
|
|
|
551
551
|
*/
|
|
552
552
|
stackAllItems?: boolean;
|
|
553
553
|
};
|
|
554
|
-
export
|
|
554
|
+
export type SearchParameters = Record<string, string | number | boolean | null | undefined>;
|
|
555
555
|
/**
|
|
556
556
|
All parsing methods supported by Got.
|
|
557
557
|
*/
|
|
558
|
-
export
|
|
559
|
-
|
|
560
|
-
export
|
|
561
|
-
export
|
|
558
|
+
export type ResponseType = 'json' | 'buffer' | 'text';
|
|
559
|
+
type OptionsToSkip = 'searchParameters' | 'followRedirects' | 'auth' | 'toJSON' | 'merge' | 'createNativeRequestOptions' | 'getRequestFunction' | 'getFallbackRequestFunction' | 'freeze';
|
|
560
|
+
export type InternalsType = Except<Options, OptionsToSkip>;
|
|
561
|
+
export type OptionsError = NodeJS.ErrnoException & {
|
|
562
562
|
options?: Options;
|
|
563
563
|
};
|
|
564
|
-
export
|
|
564
|
+
export type OptionsInit = Except<Partial<InternalsType>, 'hooks' | 'retry'> & {
|
|
565
565
|
hooks?: Partial<Hooks>;
|
|
566
566
|
retry?: Partial<RetryOptions>;
|
|
567
567
|
};
|
|
@@ -1193,7 +1193,7 @@ export default class Options {
|
|
|
1193
1193
|
passphrase: string | undefined;
|
|
1194
1194
|
pfx: PfxType;
|
|
1195
1195
|
rejectUnauthorized: boolean | undefined;
|
|
1196
|
-
checkServerIdentity:
|
|
1196
|
+
checkServerIdentity: typeof checkServerIdentity | CheckServerIdentityFunction;
|
|
1197
1197
|
ciphers: string | undefined;
|
|
1198
1198
|
honorCipherOrder: boolean | undefined;
|
|
1199
1199
|
minVersion: import("tls").SecureVersion | undefined;
|
|
@@ -1221,16 +1221,20 @@ export default class Options {
|
|
|
1221
1221
|
createConnection: CreateConnectionFunction | undefined;
|
|
1222
1222
|
timeout: number | undefined;
|
|
1223
1223
|
h2session: http2wrapper.ClientHttp2Session | undefined;
|
|
1224
|
-
|
|
1225
|
-
|
|
1224
|
+
_defaultAgent?: http.Agent | undefined;
|
|
1225
|
+
auth?: string | null | undefined;
|
|
1226
|
+
defaultPort?: string | number | undefined;
|
|
1227
|
+
hints?: number | undefined;
|
|
1226
1228
|
host?: string | null | undefined;
|
|
1227
1229
|
hostname?: string | null | undefined;
|
|
1230
|
+
insecureHTTPParser?: boolean | undefined;
|
|
1231
|
+
localPort?: number | undefined;
|
|
1232
|
+
path?: string | null | undefined;
|
|
1228
1233
|
port?: string | number | null | undefined;
|
|
1229
|
-
|
|
1234
|
+
protocol?: string | null | undefined;
|
|
1235
|
+
signal?: AbortSignal | undefined;
|
|
1230
1236
|
socketPath?: string | undefined;
|
|
1231
|
-
|
|
1232
|
-
auth?: string | null | undefined;
|
|
1233
|
-
_defaultAgent?: http.Agent | undefined;
|
|
1237
|
+
uniqueHeaders?: (string | string[])[] | undefined;
|
|
1234
1238
|
clientCertEngine?: string | undefined;
|
|
1235
1239
|
privateKeyEngine?: string | undefined;
|
|
1236
1240
|
privateKeyIdentifier?: string | undefined;
|
|
@@ -691,7 +691,6 @@ export default class Options {
|
|
|
691
691
|
const urlString = `${this.prefixUrl}${value.toString()}`;
|
|
692
692
|
const url = new URL(urlString);
|
|
693
693
|
this._internals.url = url;
|
|
694
|
-
decodeURI(urlString);
|
|
695
694
|
if (url.protocol === 'unix:') {
|
|
696
695
|
url.href = `http://unix${url.pathname}${url.search}`;
|
|
697
696
|
}
|
|
@@ -6,7 +6,7 @@ import type { IncomingMessageWithTimings, Timings } from '@szmarczak/http-timer'
|
|
|
6
6
|
import { RequestError } from './errors.js';
|
|
7
7
|
import type { ParseJsonFunction, ResponseType } from './options.js';
|
|
8
8
|
import type Request from './index.js';
|
|
9
|
-
export
|
|
9
|
+
export type PlainResponse = {
|
|
10
10
|
/**
|
|
11
11
|
The original request URL.
|
|
12
12
|
*/
|
|
@@ -88,7 +88,7 @@ export declare type PlainResponse = {
|
|
|
88
88
|
*/
|
|
89
89
|
ok: boolean;
|
|
90
90
|
} & IncomingMessageWithTimings;
|
|
91
|
-
export
|
|
91
|
+
export type Response<T = unknown> = {
|
|
92
92
|
/**
|
|
93
93
|
The result of the request.
|
|
94
94
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ClientRequest } from 'node:http';
|
|
2
2
|
declare const reentry: unique symbol;
|
|
3
|
-
|
|
3
|
+
type TimedOutOptions = {
|
|
4
4
|
host?: string;
|
|
5
5
|
hostname?: string;
|
|
6
6
|
protocol?: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type Delays = {
|
|
9
9
|
lookup?: number;
|
|
10
10
|
socket?: number;
|
|
11
11
|
connect?: number;
|
|
@@ -15,7 +15,7 @@ export declare type Delays = {
|
|
|
15
15
|
read?: number;
|
|
16
16
|
request?: number;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
18
|
+
export type ErrorCode = 'ETIMEDOUT' | 'ECONNRESET' | 'EADDRINUSE' | 'ECONNREFUSED' | 'EPIPE' | 'ENOTFOUND' | 'ENETUNREACH' | 'EAI_AGAIN';
|
|
19
19
|
export declare class TimeoutError extends Error {
|
|
20
20
|
event: string;
|
|
21
21
|
code: ErrorCode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type { Readable } from 'node:stream';
|
|
3
|
-
|
|
3
|
+
type FormData = {
|
|
4
4
|
getBoundary: () => string;
|
|
5
5
|
getLength: (callback: (error: Error | null, length: number) => void) => void;
|
|
6
6
|
} & Readable;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type { EventEmitter } from 'node:events';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
type Origin = EventEmitter;
|
|
4
|
+
type Event = string | symbol;
|
|
5
|
+
type Fn = (...args: any[]) => void;
|
|
6
|
+
type Unhandler = {
|
|
7
7
|
once: (origin: Origin, event: Event, fn: Fn) => void;
|
|
8
8
|
unhandleAll: () => void;
|
|
9
9
|
};
|
package/dist/source/types.d.ts
CHANGED
|
@@ -7,12 +7,12 @@ import type { Response } from './core/response.js';
|
|
|
7
7
|
import type Options from './core/options.js';
|
|
8
8
|
import type { PaginationOptions, OptionsInit } from './core/options.js';
|
|
9
9
|
import type Request from './core/index.js';
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type Except<ObjectType, KeysType extends keyof ObjectType> = Pick<ObjectType, Exclude<keyof ObjectType, KeysType>>;
|
|
11
|
+
type Merge<FirstType, SecondType> = Except<FirstType, Extract<keyof FirstType, keyof SecondType>> & SecondType;
|
|
12
12
|
/**
|
|
13
13
|
Defaults for each Got instance.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type InstanceDefaults = {
|
|
16
16
|
/**
|
|
17
17
|
An object containing the default options of Got.
|
|
18
18
|
*/
|
|
@@ -36,16 +36,16 @@ export declare type InstanceDefaults = {
|
|
|
36
36
|
/**
|
|
37
37
|
A Request object returned by calling Got, or any of the Got HTTP alias request functions.
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type GotReturn = Request | CancelableRequest;
|
|
40
40
|
/**
|
|
41
41
|
A function to handle options and returns a Request object.
|
|
42
42
|
It acts sort of like a "global hook", and will be called before any actual request is made.
|
|
43
43
|
*/
|
|
44
|
-
export
|
|
44
|
+
export type HandlerFunction = <T extends GotReturn>(options: Options, next: (options: Options) => T) => T | Promise<T>;
|
|
45
45
|
/**
|
|
46
46
|
The options available for `got.extend()`.
|
|
47
47
|
*/
|
|
48
|
-
export
|
|
48
|
+
export type ExtendOptions = {
|
|
49
49
|
/**
|
|
50
50
|
An array of functions. You execute them directly by calling `got()`.
|
|
51
51
|
They are some sort of "global hooks" - these functions are called first.
|
|
@@ -62,39 +62,39 @@ export declare type ExtendOptions = {
|
|
|
62
62
|
*/
|
|
63
63
|
mutableDefaults?: boolean;
|
|
64
64
|
} & OptionsInit;
|
|
65
|
-
export
|
|
65
|
+
export type OptionsOfTextResponseBody = Merge<OptionsInit, {
|
|
66
66
|
isStream?: false;
|
|
67
67
|
resolveBodyOnly?: false;
|
|
68
68
|
responseType?: 'text';
|
|
69
69
|
}>;
|
|
70
|
-
export
|
|
70
|
+
export type OptionsOfJSONResponseBody = Merge<OptionsInit, {
|
|
71
71
|
isStream?: false;
|
|
72
72
|
resolveBodyOnly?: false;
|
|
73
73
|
responseType?: 'json';
|
|
74
74
|
}>;
|
|
75
|
-
export
|
|
75
|
+
export type OptionsOfBufferResponseBody = Merge<OptionsInit, {
|
|
76
76
|
isStream?: false;
|
|
77
77
|
resolveBodyOnly?: false;
|
|
78
78
|
responseType: 'buffer';
|
|
79
79
|
}>;
|
|
80
|
-
export
|
|
80
|
+
export type OptionsOfUnknownResponseBody = Merge<OptionsInit, {
|
|
81
81
|
isStream?: false;
|
|
82
82
|
resolveBodyOnly?: false;
|
|
83
83
|
}>;
|
|
84
|
-
export
|
|
85
|
-
export
|
|
84
|
+
export type StrictOptions = Except<OptionsInit, 'isStream' | 'responseType' | 'resolveBodyOnly'>;
|
|
85
|
+
export type StreamOptions = Merge<OptionsInit, {
|
|
86
86
|
isStream?: true;
|
|
87
87
|
}>;
|
|
88
|
-
|
|
88
|
+
type ResponseBodyOnly = {
|
|
89
89
|
resolveBodyOnly: true;
|
|
90
90
|
};
|
|
91
|
-
export
|
|
91
|
+
export type OptionsWithPagination<T = unknown, R = unknown> = Merge<OptionsInit, {
|
|
92
92
|
pagination?: PaginationOptions<T, R>;
|
|
93
93
|
}>;
|
|
94
94
|
/**
|
|
95
95
|
An instance of `got.paginate`.
|
|
96
96
|
*/
|
|
97
|
-
export
|
|
97
|
+
export type GotPaginate = {
|
|
98
98
|
/**
|
|
99
99
|
Same as `GotPaginate.each`.
|
|
100
100
|
*/
|
|
@@ -147,7 +147,7 @@ export declare type GotPaginate = {
|
|
|
147
147
|
*/
|
|
148
148
|
all: (<T, R = unknown>(url: string | URL, options?: OptionsWithPagination<T, R>) => Promise<T[]>) & (<T, R = unknown>(options?: OptionsWithPagination<T, R>) => Promise<T[]>);
|
|
149
149
|
};
|
|
150
|
-
export
|
|
150
|
+
export type GotRequestFunction = {
|
|
151
151
|
(url: string | URL, options?: OptionsOfTextResponseBody): CancelableRequest<Response<string>>;
|
|
152
152
|
<T>(url: string | URL, options?: OptionsOfJSONResponseBody): CancelableRequest<Response<T>>;
|
|
153
153
|
(url: string | URL, options?: OptionsOfBufferResponseBody): CancelableRequest<Response<Buffer>>;
|
|
@@ -175,8 +175,8 @@ export declare type GotRequestFunction = {
|
|
|
175
175
|
/**
|
|
176
176
|
All available HTTP request methods provided by Got.
|
|
177
177
|
*/
|
|
178
|
-
export
|
|
179
|
-
|
|
178
|
+
export type HTTPAlias = 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete';
|
|
179
|
+
type GotStreamFunction = ((url?: string | URL, options?: Merge<OptionsInit, {
|
|
180
180
|
isStream?: true;
|
|
181
181
|
}>) => Request) & ((options?: Merge<OptionsInit, {
|
|
182
182
|
isStream?: true;
|
|
@@ -184,11 +184,11 @@ declare type GotStreamFunction = ((url?: string | URL, options?: Merge<OptionsIn
|
|
|
184
184
|
/**
|
|
185
185
|
An instance of `got.stream()`.
|
|
186
186
|
*/
|
|
187
|
-
export
|
|
187
|
+
export type GotStream = GotStreamFunction & Record<HTTPAlias, GotStreamFunction>;
|
|
188
188
|
/**
|
|
189
189
|
An instance of `got`.
|
|
190
190
|
*/
|
|
191
|
-
export
|
|
191
|
+
export type Got = {
|
|
192
192
|
/**
|
|
193
193
|
Sets `options.isStream` to `true`.
|
|
194
194
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "got",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.6.0",
|
|
4
4
|
"description": "Human-friendly and powerful HTTP request library for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/got",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@sindresorhus/is": "^5.2.0",
|
|
49
49
|
"@szmarczak/http-timer": "^5.0.1",
|
|
50
50
|
"cacheable-lookup": "^7.0.0",
|
|
51
|
-
"cacheable-request": "^10.2.
|
|
51
|
+
"cacheable-request": "^10.2.8",
|
|
52
52
|
"decompress-response": "^6.0.0",
|
|
53
53
|
"form-data-encoder": "^2.1.2",
|
|
54
54
|
"get-stream": "^6.0.1",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@hapi/bourne": "^3.0.0",
|
|
62
62
|
"@sindresorhus/tsconfig": "^3.0.1",
|
|
63
|
-
"@sinonjs/fake-timers": "^
|
|
63
|
+
"@sinonjs/fake-timers": "^10.0.2",
|
|
64
64
|
"@types/benchmark": "^2.1.2",
|
|
65
|
-
"@types/express": "^4.17.
|
|
66
|
-
"@types/node": "^18.
|
|
65
|
+
"@types/express": "^4.17.17",
|
|
66
|
+
"@types/node": "^18.14.5",
|
|
67
67
|
"@types/pem": "^1.9.6",
|
|
68
68
|
"@types/pify": "^5.0.1",
|
|
69
69
|
"@types/readable-stream": "^2.3.13",
|
|
@@ -71,11 +71,11 @@
|
|
|
71
71
|
"@types/sinon": "^10.0.11",
|
|
72
72
|
"@types/sinonjs__fake-timers": "^8.1.1",
|
|
73
73
|
"@types/tough-cookie": "^4.0.1",
|
|
74
|
-
"ava": "^
|
|
74
|
+
"ava": "^5.2.0",
|
|
75
75
|
"axios": "^0.27.2",
|
|
76
76
|
"benchmark": "^2.1.4",
|
|
77
77
|
"bluebird": "^3.7.2",
|
|
78
|
-
"body-parser": "^1.
|
|
78
|
+
"body-parser": "^1.20.2",
|
|
79
79
|
"create-cert": "^1.0.6",
|
|
80
80
|
"create-test-server": "^3.0.1",
|
|
81
81
|
"del-cli": "^5.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"express": "^4.17.3",
|
|
84
84
|
"form-data": "^4.0.0",
|
|
85
85
|
"formdata-node": "^5.0.0",
|
|
86
|
-
"nock": "^13.
|
|
86
|
+
"nock": "^13.3.0",
|
|
87
87
|
"node-fetch": "^3.2.3",
|
|
88
88
|
"np": "^7.6.0",
|
|
89
89
|
"nyc": "^15.1.0",
|
|
@@ -92,16 +92,15 @@
|
|
|
92
92
|
"pify": "^6.0.0",
|
|
93
93
|
"readable-stream": "^4.2.0",
|
|
94
94
|
"request": "^2.88.2",
|
|
95
|
-
"sinon": "^
|
|
95
|
+
"sinon": "^15.0.1",
|
|
96
96
|
"slow-stream": "0.0.4",
|
|
97
97
|
"tempy": "^3.0.0",
|
|
98
98
|
"then-busboy": "^5.2.1",
|
|
99
|
-
"
|
|
100
|
-
"tough-cookie": "4.0.0",
|
|
99
|
+
"tough-cookie": "4.1.2",
|
|
101
100
|
"ts-node": "^10.8.2",
|
|
102
|
-
"type-fest": "^3.
|
|
103
|
-
"typescript": "~4.
|
|
104
|
-
"xo": "^0.
|
|
101
|
+
"type-fest": "^3.6.1",
|
|
102
|
+
"typescript": "~4.9.5",
|
|
103
|
+
"xo": "^0.53.1"
|
|
105
104
|
},
|
|
106
105
|
"sideEffects": false,
|
|
107
106
|
"ava": {
|
package/readme.md
CHANGED
|
@@ -28,14 +28,6 @@
|
|
|
28
28
|
</a>
|
|
29
29
|
<br>
|
|
30
30
|
<br>
|
|
31
|
-
<a href="https://www.monito.com">
|
|
32
|
-
<div>
|
|
33
|
-
<img src="https://sindresorhus.com/assets/thanks/monito-logo.svg" width="210">
|
|
34
|
-
</div>
|
|
35
|
-
<b>Find the cheapest way to send money abroad</b>
|
|
36
|
-
</a>
|
|
37
|
-
<br>
|
|
38
|
-
<br>
|
|
39
31
|
<br>
|
|
40
32
|
<a href="https://www.useanvil.com/?utm_source=sindresorhus#gh-light-mode-only">
|
|
41
33
|
<div>
|
|
@@ -67,20 +59,6 @@
|
|
|
67
59
|
</a>
|
|
68
60
|
<br>
|
|
69
61
|
<br>
|
|
70
|
-
<a href="https://sizzy.co/?utm_campaign=github_repo&utm_source=github&utm_medium=referral&utm_content=got&utm_term=sindre">
|
|
71
|
-
<div>
|
|
72
|
-
<img src="https://sindresorhus.com/assets/thanks/sizzy-logo.png" width="240" alt="Sizzy">
|
|
73
|
-
</div>
|
|
74
|
-
<div>
|
|
75
|
-
<sub>
|
|
76
|
-
<b>Before Sizzy:</b> web development is stressing you out, responsive design is hard, you have an overwhelming amount of opened tabs & apps.
|
|
77
|
-
<br>
|
|
78
|
-
<b>After Sizzy:</b> all the tools you need in one place, responsive design is a breeze, no more context switching.
|
|
79
|
-
</sub>
|
|
80
|
-
</div>
|
|
81
|
-
</a>
|
|
82
|
-
<br>
|
|
83
|
-
<br>
|
|
84
62
|
<br>
|
|
85
63
|
<br>
|
|
86
64
|
</p>
|
|
@@ -110,7 +88,9 @@ For browser usage, we recommend [Ky](https://github.com/sindresorhus/ky) by the
|
|
|
110
88
|
npm install got
|
|
111
89
|
```
|
|
112
90
|
|
|
113
|
-
**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
|
|
91
|
+
**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.
|
|
92
|
+
|
|
93
|
+
**Got v11 (the previous major version) is no longer maintained and we will not accept any backport requests.**
|
|
114
94
|
|
|
115
95
|
## Take a peek
|
|
116
96
|
|
|
@@ -210,38 +190,38 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
210
190
|
|
|
211
191
|
## Comparison
|
|
212
192
|
|
|
213
|
-
| | `got` | [`
|
|
214
|
-
|
|
215
|
-
| HTTP/2 support | :heavy_check_mark:¹ | :x:
|
|
216
|
-
| Browser support | :x: | :
|
|
217
|
-
| Promise API | :heavy_check_mark: | :heavy_check_mark:
|
|
218
|
-
| Stream API | :heavy_check_mark: |
|
|
219
|
-
| Pagination API | :heavy_check_mark: | :x:
|
|
220
|
-
| Request cancelation | :heavy_check_mark: | :
|
|
221
|
-
| RFC compliant caching | :heavy_check_mark: | :x:
|
|
222
|
-
| Cookies (out-of-box) | :heavy_check_mark: | :
|
|
223
|
-
| Follows redirects | :heavy_check_mark: | :heavy_check_mark:
|
|
224
|
-
| Retries on failure | :heavy_check_mark: | :x:
|
|
225
|
-
| Progress events | :heavy_check_mark: | :x:
|
|
226
|
-
| Handles gzip/deflate | :heavy_check_mark: | :heavy_check_mark:
|
|
227
|
-
| Advanced timeouts | :heavy_check_mark: | :x:
|
|
228
|
-
| Timings | :heavy_check_mark: | :
|
|
229
|
-
| Errors with metadata | :heavy_check_mark: | :x:
|
|
230
|
-
| JSON mode | :heavy_check_mark: | :heavy_check_mark:
|
|
231
|
-
| Custom defaults | :heavy_check_mark: | :
|
|
232
|
-
| Composable | :heavy_check_mark: | :x:
|
|
233
|
-
| Hooks | :heavy_check_mark: | :x:
|
|
234
|
-
| Issues open | [![][gio]][g1] | [![][
|
|
235
|
-
| Issues closed | [![][gic]][g2] | [![][
|
|
236
|
-
| Downloads | [![][gd]][g3] | [![][
|
|
237
|
-
| Coverage | TBD
|
|
238
|
-
| Build | [![][gb]][g5] | [![][
|
|
239
|
-
| Bugs | [![][gbg]][g6] | [![][
|
|
240
|
-
| Dependents | [![][gdp]][g7] | [![][
|
|
241
|
-
| Install size | [![][gis]][g8] | [![][
|
|
242
|
-
| GitHub stars | [![][gs]][g9] | [![][
|
|
243
|
-
| TypeScript support | [![][gts]][g10] | [![][
|
|
244
|
-
| Last commit | [![][glc]][g11] | [![][
|
|
193
|
+
| | `got` | [`node-fetch`][n0] | [`ky`][k0] | [`axios`][a0] | [`superagent`][s0] |
|
|
194
|
+
|-----------------------|:-------------------:|:--------------------:|:------------------------:|:------------------:|:----------------------:|
|
|
195
|
+
| HTTP/2 support | :heavy_check_mark:¹ | :x: | :x: | :x: | :heavy_check_mark:\*\* |
|
|
196
|
+
| Browser support | :x: | :heavy_check_mark:\* | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
197
|
+
| Promise API | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
198
|
+
| Stream API | :heavy_check_mark: | Node.js only | :x: | :x: | :heavy_check_mark: |
|
|
199
|
+
| Pagination API | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
200
|
+
| Request cancelation | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
201
|
+
| RFC compliant caching | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
202
|
+
| Cookies (out-of-box) | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
203
|
+
| Follows redirects | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
204
|
+
| Retries on failure | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: | :heavy_check_mark: |
|
|
205
|
+
| Progress events | :heavy_check_mark: | :x: | :heavy_check_mark:\*\*\* | Browser only | :heavy_check_mark: |
|
|
206
|
+
| Handles gzip/deflate | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
207
|
+
| Advanced timeouts | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
208
|
+
| Timings | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
209
|
+
| Errors with metadata | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :x: |
|
|
210
|
+
| JSON mode | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
211
|
+
| Custom defaults | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :x: |
|
|
212
|
+
| Composable | :heavy_check_mark: | :x: | :x: | :x: | :heavy_check_mark: |
|
|
213
|
+
| Hooks | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :x: |
|
|
214
|
+
| Issues open | [![][gio]][g1] | [![][nio]][n1] | [![][kio]][k1] | [![][aio]][a1] | [![][sio]][s1] |
|
|
215
|
+
| Issues closed | [![][gic]][g2] | [![][nic]][n2] | [![][kic]][k2] | [![][aic]][a2] | [![][sic]][s2] |
|
|
216
|
+
| Downloads | [![][gd]][g3] | [![][nd]][n3] | [![][kd]][k3] | [![][ad]][a3] | [![][sd]][s3] |
|
|
217
|
+
| Coverage | TBD | [![][nc]][n4] | [![][kc]][k4] | [![][ac]][a4] | [![][sc]][s4] |
|
|
218
|
+
| Build | [![][gb]][g5] | [![][nb]][n5] | [![][kb]][k5] | [![][ab]][a5] | [![][sb]][s5] |
|
|
219
|
+
| Bugs | [![][gbg]][g6] | [![][nbg]][n6] | [![][kbg]][k6] | [![][abg]][a6] | [![][sbg]][s6] |
|
|
220
|
+
| Dependents | [![][gdp]][g7] | [![][ndp]][n7] | [![][kdp]][k7] | [![][adp]][a7] | [![][sdp]][s7] |
|
|
221
|
+
| Install size | [![][gis]][g8] | [![][nis]][n8] | [![][kis]][k8] | [![][ais]][a8] | [![][sis]][s8] |
|
|
222
|
+
| GitHub stars | [![][gs]][g9] | [![][ns]][n9] | [![][ks]][k9] | [![][as]][a9] | [![][ss]][s9] |
|
|
223
|
+
| TypeScript support | [![][gts]][g10] | [![][nts]][n10] | [![][kts]][k10] | [![][ats]][a10] | [![][sts]][s11] |
|
|
224
|
+
| Last commit | [![][glc]][g11] | [![][nlc]][n11] | [![][klc]][k11] | [![][alc]][a11] | [![][slc]][s11] |
|
|
245
225
|
|
|
246
226
|
\* It's almost API compatible with the browser `fetch` API.\
|
|
247
227
|
\*\* Need to switch the protocol manually. Doesn't accept PUSH streams and doesn't reuse HTTP/2 sessions.\
|
|
@@ -252,7 +232,6 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
252
232
|
|
|
253
233
|
<!-- GITHUB -->
|
|
254
234
|
[k0]: https://github.com/sindresorhus/ky
|
|
255
|
-
[r0]: https://github.com/request/request
|
|
256
235
|
[n0]: https://github.com/node-fetch/node-fetch
|
|
257
236
|
[a0]: https://github.com/axios/axios
|
|
258
237
|
[s0]: https://github.com/visionmedia/superagent
|
|
@@ -260,14 +239,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
260
239
|
<!-- ISSUES OPEN -->
|
|
261
240
|
[gio]: https://img.shields.io/github/issues-raw/sindresorhus/got?color=gray&label
|
|
262
241
|
[kio]: https://img.shields.io/github/issues-raw/sindresorhus/ky?color=gray&label
|
|
263
|
-
[rio]: https://img.shields.io/github/issues-raw/request/request?color=gray&label
|
|
264
242
|
[nio]: https://img.shields.io/github/issues-raw/bitinn/node-fetch?color=gray&label
|
|
265
243
|
[aio]: https://img.shields.io/github/issues-raw/axios/axios?color=gray&label
|
|
266
244
|
[sio]: https://img.shields.io/github/issues-raw/visionmedia/superagent?color=gray&label
|
|
267
245
|
|
|
268
246
|
[g1]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
269
247
|
[k1]: https://github.com/sindresorhus/ky/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
270
|
-
[r1]: https://github.com/request/request/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
271
248
|
[n1]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
272
249
|
[a1]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
273
250
|
[s1]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
@@ -275,14 +252,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
275
252
|
<!-- ISSUES CLOSED -->
|
|
276
253
|
[gic]: https://img.shields.io/github/issues-closed-raw/sindresorhus/got?color=blue&label
|
|
277
254
|
[kic]: https://img.shields.io/github/issues-closed-raw/sindresorhus/ky?color=blue&label
|
|
278
|
-
[ric]: https://img.shields.io/github/issues-closed-raw/request/request?color=blue&label
|
|
279
255
|
[nic]: https://img.shields.io/github/issues-closed-raw/bitinn/node-fetch?color=blue&label
|
|
280
256
|
[aic]: https://img.shields.io/github/issues-closed-raw/axios/axios?color=blue&label
|
|
281
257
|
[sic]: https://img.shields.io/github/issues-closed-raw/visionmedia/superagent?color=blue&label
|
|
282
258
|
|
|
283
259
|
[g2]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
284
260
|
[k2]: https://github.com/sindresorhus/ky/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
285
|
-
[r2]: https://github.com/request/request/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
286
261
|
[n2]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
287
262
|
[a2]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
288
263
|
[s2]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
@@ -290,14 +265,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
290
265
|
<!-- DOWNLOADS -->
|
|
291
266
|
[gd]: https://img.shields.io/npm/dm/got?color=darkgreen&label
|
|
292
267
|
[kd]: https://img.shields.io/npm/dm/ky?color=darkgreen&label
|
|
293
|
-
[rd]: https://img.shields.io/npm/dm/request?color=darkgreen&label
|
|
294
268
|
[nd]: https://img.shields.io/npm/dm/node-fetch?color=darkgreen&label
|
|
295
269
|
[ad]: https://img.shields.io/npm/dm/axios?color=darkgreen&label
|
|
296
270
|
[sd]: https://img.shields.io/npm/dm/superagent?color=darkgreen&label
|
|
297
271
|
|
|
298
272
|
[g3]: https://www.npmjs.com/package/got
|
|
299
273
|
[k3]: https://www.npmjs.com/package/ky
|
|
300
|
-
[r3]: https://www.npmjs.com/package/request
|
|
301
274
|
[n3]: https://www.npmjs.com/package/node-fetch
|
|
302
275
|
[a3]: https://www.npmjs.com/package/axios
|
|
303
276
|
[s3]: https://www.npmjs.com/package/superagent
|
|
@@ -305,14 +278,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
305
278
|
<!-- COVERAGE -->
|
|
306
279
|
[gc]: https://img.shields.io/coveralls/github/sindresorhus/got?color=0b9062&label
|
|
307
280
|
[kc]: https://img.shields.io/codecov/c/github/sindresorhus/ky?color=0b9062&label
|
|
308
|
-
[rc]: https://img.shields.io/coveralls/github/request/request?color=0b9062&label
|
|
309
281
|
[nc]: https://img.shields.io/coveralls/github/bitinn/node-fetch?color=0b9062&label
|
|
310
282
|
[ac]: https://img.shields.io/coveralls/github/mzabriskie/axios?color=0b9062&label
|
|
311
283
|
[sc]: https://img.shields.io/codecov/c/github/visionmedia/superagent?color=0b9062&label
|
|
312
284
|
|
|
313
285
|
[g4]: https://coveralls.io/github/sindresorhus/got
|
|
314
286
|
[k4]: https://codecov.io/gh/sindresorhus/ky
|
|
315
|
-
[r4]: https://coveralls.io/github/request/request
|
|
316
287
|
[n4]: https://coveralls.io/github/bitinn/node-fetch
|
|
317
288
|
[a4]: https://coveralls.io/github/mzabriskie/axios
|
|
318
289
|
[s4]: https://codecov.io/gh/visionmedia/superagent
|
|
@@ -320,14 +291,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
320
291
|
<!-- BUILD -->
|
|
321
292
|
[gb]: https://github.com/sindresorhus/got/actions/workflows/main.yml/badge.svg
|
|
322
293
|
[kb]: https://github.com/sindresorhus/ky/actions/workflows/main.yml/badge.svg
|
|
323
|
-
[rb]: https://img.shields.io/travis/request/request?label
|
|
324
294
|
[nb]: https://img.shields.io/travis/bitinn/node-fetch?label
|
|
325
295
|
[ab]: https://img.shields.io/travis/axios/axios?label
|
|
326
296
|
[sb]: https://img.shields.io/travis/visionmedia/superagent?label
|
|
327
297
|
|
|
328
298
|
[g5]: https://github.com/sindresorhus/got/actions/workflows/main.yml
|
|
329
299
|
[k5]: https://github.com/sindresorhus/ky/actions/workflows/main.yml
|
|
330
|
-
[r5]: https://travis-ci.org/github/request/request
|
|
331
300
|
[n5]: https://travis-ci.org/github/bitinn/node-fetch
|
|
332
301
|
[a5]: https://travis-ci.org/github/axios/axios
|
|
333
302
|
[s5]: https://travis-ci.org/github/visionmedia/superagent
|
|
@@ -335,14 +304,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
335
304
|
<!-- BUGS -->
|
|
336
305
|
[gbg]: https://img.shields.io/github/issues-raw/sindresorhus/got/bug?color=darkred&label
|
|
337
306
|
[kbg]: https://img.shields.io/github/issues-raw/sindresorhus/ky/bug?color=darkred&label
|
|
338
|
-
[rbg]: https://img.shields.io/github/issues-raw/request/request/Needs%20investigation?color=darkred&label
|
|
339
307
|
[nbg]: https://img.shields.io/github/issues-raw/bitinn/node-fetch/bug?color=darkred&label
|
|
340
308
|
[abg]: https://img.shields.io/github/issues-raw/axios/axios/type:confirmed%20bug?color=darkred&label
|
|
341
309
|
[sbg]: https://img.shields.io/github/issues-raw/visionmedia/superagent/Bug?color=darkred&label
|
|
342
310
|
|
|
343
311
|
[g6]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
|
|
344
312
|
[k6]: https://github.com/sindresorhus/ky/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
|
|
345
|
-
[r6]: https://github.com/request/request/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A"Needs+investigation"
|
|
346
313
|
[n6]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
|
|
347
314
|
[a6]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22type%3Aconfirmed+bug%22
|
|
348
315
|
[s6]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ABug
|
|
@@ -350,14 +317,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
350
317
|
<!-- DEPENDENTS -->
|
|
351
318
|
[gdp]: https://badgen.net/npm/dependents/got?color=orange&label
|
|
352
319
|
[kdp]: https://badgen.net/npm/dependents/ky?color=orange&label
|
|
353
|
-
[rdp]: https://badgen.net/npm/dependents/request?color=orange&label
|
|
354
320
|
[ndp]: https://badgen.net/npm/dependents/node-fetch?color=orange&label
|
|
355
321
|
[adp]: https://badgen.net/npm/dependents/axios?color=orange&label
|
|
356
322
|
[sdp]: https://badgen.net/npm/dependents/superagent?color=orange&label
|
|
357
323
|
|
|
358
324
|
[g7]: https://www.npmjs.com/package/got?activeTab=dependents
|
|
359
325
|
[k7]: https://www.npmjs.com/package/ky?activeTab=dependents
|
|
360
|
-
[r7]: https://www.npmjs.com/package/request?activeTab=dependents
|
|
361
326
|
[n7]: https://www.npmjs.com/package/node-fetch?activeTab=dependents
|
|
362
327
|
[a7]: https://www.npmjs.com/package/axios?activeTab=dependents
|
|
363
328
|
[s7]: https://www.npmjs.com/package/visionmedia?activeTab=dependents
|
|
@@ -365,14 +330,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
365
330
|
<!-- INSTALL SIZE -->
|
|
366
331
|
[gis]: https://badgen.net/packagephobia/install/got?color=blue&label
|
|
367
332
|
[kis]: https://badgen.net/packagephobia/install/ky?color=blue&label
|
|
368
|
-
[ris]: https://badgen.net/packagephobia/install/request?color=blue&label
|
|
369
333
|
[nis]: https://badgen.net/packagephobia/install/node-fetch?color=blue&label
|
|
370
334
|
[ais]: https://badgen.net/packagephobia/install/axios?color=blue&label
|
|
371
335
|
[sis]: https://badgen.net/packagephobia/install/superagent?color=blue&label
|
|
372
336
|
|
|
373
337
|
[g8]: https://packagephobia.com/result?p=got
|
|
374
338
|
[k8]: https://packagephobia.com/result?p=ky
|
|
375
|
-
[r8]: https://packagephobia.com/result?p=request
|
|
376
339
|
[n8]: https://packagephobia.com/result?p=node-fetch
|
|
377
340
|
[a8]: https://packagephobia.com/result?p=axios
|
|
378
341
|
[s8]: https://packagephobia.com/result?p=superagent
|
|
@@ -380,14 +343,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
380
343
|
<!-- GITHUB STARS -->
|
|
381
344
|
[gs]: https://img.shields.io/github/stars/sindresorhus/got?color=white&label
|
|
382
345
|
[ks]: https://img.shields.io/github/stars/sindresorhus/ky?color=white&label
|
|
383
|
-
[rs]: https://img.shields.io/github/stars/request/request?color=white&label
|
|
384
346
|
[ns]: https://img.shields.io/github/stars/bitinn/node-fetch?color=white&label
|
|
385
347
|
[as]: https://img.shields.io/github/stars/axios/axios?color=white&label
|
|
386
348
|
[ss]: https://img.shields.io/github/stars/visionmedia/superagent?color=white&label
|
|
387
349
|
|
|
388
350
|
[g9]: https://github.com/sindresorhus/got
|
|
389
351
|
[k9]: https://github.com/sindresorhus/ky
|
|
390
|
-
[r9]: https://github.com/request/request
|
|
391
352
|
[n9]: https://github.com/node-fetch/node-fetch
|
|
392
353
|
[a9]: https://github.com/axios/axios
|
|
393
354
|
[s9]: https://github.com/visionmedia/superagent
|
|
@@ -395,14 +356,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
395
356
|
<!-- TYPESCRIPT SUPPORT -->
|
|
396
357
|
[gts]: https://badgen.net/npm/types/got?label
|
|
397
358
|
[kts]: https://badgen.net/npm/types/ky?label
|
|
398
|
-
[rts]: https://badgen.net/npm/types/request?label
|
|
399
359
|
[nts]: https://badgen.net/npm/types/node-fetch?label
|
|
400
360
|
[ats]: https://badgen.net/npm/types/axios?label
|
|
401
361
|
[sts]: https://badgen.net/npm/types/superagent?label
|
|
402
362
|
|
|
403
363
|
[g10]: https://github.com/sindresorhus/got
|
|
404
364
|
[k10]: https://github.com/sindresorhus/ky
|
|
405
|
-
[r10]: https://github.com/request/request
|
|
406
365
|
[n10]: https://github.com/node-fetch/node-fetch
|
|
407
366
|
[a10]: https://github.com/axios/axios
|
|
408
367
|
[s10]: https://github.com/visionmedia/superagent
|
|
@@ -410,14 +369,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
410
369
|
<!-- LAST COMMIT -->
|
|
411
370
|
[glc]: https://img.shields.io/github/last-commit/sindresorhus/got?color=gray&label
|
|
412
371
|
[klc]: https://img.shields.io/github/last-commit/sindresorhus/ky?color=gray&label
|
|
413
|
-
[rlc]: https://img.shields.io/github/last-commit/request/request?color=gray&label
|
|
414
372
|
[nlc]: https://img.shields.io/github/last-commit/bitinn/node-fetch?color=gray&label
|
|
415
373
|
[alc]: https://img.shields.io/github/last-commit/axios/axios?color=gray&label
|
|
416
374
|
[slc]: https://img.shields.io/github/last-commit/visionmedia/superagent?color=gray&label
|
|
417
375
|
|
|
418
376
|
[g11]: https://github.com/sindresorhus/got/commits
|
|
419
377
|
[k11]: https://github.com/sindresorhus/ky/commits
|
|
420
|
-
[r11]: https://github.com/request/request/commits
|
|
421
378
|
[n11]: https://github.com/node-fetch/node-fetch/commits
|
|
422
379
|
[a11]: https://github.com/axios/axios/commits
|
|
423
380
|
[s11]: https://github.com/visionmedia/superagent/commits
|