got 12.5.3 → 12.6.1
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 +5 -4
- package/dist/source/core/options.d.ts +51 -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 +54 -93
|
@@ -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;
|
|
@@ -7,7 +7,7 @@ import timer from '@szmarczak/http-timer';
|
|
|
7
7
|
import CacheableRequest, { CacheError as CacheableCacheError, } from 'cacheable-request';
|
|
8
8
|
import decompressResponse from 'decompress-response';
|
|
9
9
|
import is from '@sindresorhus/is';
|
|
10
|
-
import
|
|
10
|
+
import getStream from 'get-stream';
|
|
11
11
|
import { FormDataEncoder, isFormData as isFormDataLike } from 'form-data-encoder';
|
|
12
12
|
import getBodySize from './utils/get-body-size.js';
|
|
13
13
|
import isFormData from './utils/is-form-data.js';
|
|
@@ -21,6 +21,7 @@ import { isResponseOk } from './response.js';
|
|
|
21
21
|
import isClientRequest from './utils/is-client-request.js';
|
|
22
22
|
import isUnixSocketURL from './utils/is-unix-socket-url.js';
|
|
23
23
|
import { RequestError, ReadError, MaxRedirectsError, HTTPError, TimeoutError, UploadError, CacheError, AbortError, } from './errors.js';
|
|
24
|
+
const { buffer: getBuffer } = getStream;
|
|
24
25
|
const supportsBrotli = is.string(process.versions.brotli);
|
|
25
26
|
const methodsWithoutBody = new Set(['GET', 'HEAD']);
|
|
26
27
|
const cacheableStore = new WeakableMap();
|
|
@@ -210,8 +211,8 @@ export default class Request extends Duplex {
|
|
|
210
211
|
this.redirectUrls = [];
|
|
211
212
|
this.retryCount = 0;
|
|
212
213
|
this._stopRetry = noop;
|
|
213
|
-
this.on('pipe', source => {
|
|
214
|
-
if (source
|
|
214
|
+
this.on('pipe', (source) => {
|
|
215
|
+
if (source?.headers) {
|
|
215
216
|
Object.assign(this.options.headers, source.headers);
|
|
216
217
|
}
|
|
217
218
|
});
|
|
@@ -575,7 +576,7 @@ export default class Request extends Duplex {
|
|
|
575
576
|
}
|
|
576
577
|
const statusCode = response.statusCode;
|
|
577
578
|
const typedResponse = response;
|
|
578
|
-
typedResponse.statusMessage = typedResponse.statusMessage
|
|
579
|
+
typedResponse.statusMessage = typedResponse.statusMessage ?? http.STATUS_CODES[statusCode];
|
|
579
580
|
typedResponse.url = options.url.toString();
|
|
580
581
|
typedResponse.requestUrl = this.requestUrl;
|
|
581
582
|
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,21 @@ 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
|
-
|
|
1233
|
-
_defaultAgent?: http.Agent | undefined;
|
|
1237
|
+
uniqueHeaders?: (string | string[])[] | undefined;
|
|
1238
|
+
joinDuplicateHeaders?: boolean | undefined;
|
|
1234
1239
|
clientCertEngine?: string | undefined;
|
|
1235
1240
|
privateKeyEngine?: string | undefined;
|
|
1236
1241
|
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.1",
|
|
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,57 +28,39 @@
|
|
|
28
28
|
</a>
|
|
29
29
|
<br>
|
|
30
30
|
<br>
|
|
31
|
-
<
|
|
31
|
+
<br>
|
|
32
|
+
<a href="https://serpapi.com#gh-light-mode-only">
|
|
33
|
+
<div>
|
|
34
|
+
<img src="https://sindresorhus.com/assets/thanks/serpapi-logo-light.svg" width="130" alt="SerpApi">
|
|
35
|
+
</div>
|
|
36
|
+
<b>API to get search engine results with ease.</b>
|
|
37
|
+
</a>
|
|
38
|
+
<a href="https://serpapi.com#gh-dark-mode-only">
|
|
32
39
|
<div>
|
|
33
|
-
<img src="https://sindresorhus.com/assets/thanks/
|
|
40
|
+
<img src="https://sindresorhus.com/assets/thanks/serpapi-logo-dark.svg" width="120" alt="SerpApi">
|
|
34
41
|
</div>
|
|
35
|
-
<b>
|
|
42
|
+
<b>API to get search engine results with ease.</b>
|
|
36
43
|
</a>
|
|
37
44
|
<br>
|
|
38
45
|
<br>
|
|
39
46
|
<br>
|
|
40
|
-
<
|
|
47
|
+
<br>
|
|
48
|
+
<a href="https://dutchis.net/?ref=sindresorhus#gh-light-mode-only">
|
|
41
49
|
<div>
|
|
42
|
-
<img src="https://sindresorhus.com/assets/thanks/
|
|
50
|
+
<img src="https://sindresorhus.com/assets/thanks/dutchis-logo-light.png" width="200" alt="DutchIS">
|
|
43
51
|
</div>
|
|
44
52
|
<br>
|
|
45
|
-
<b>
|
|
46
|
-
<div>
|
|
47
|
-
<sub>
|
|
48
|
-
Easy APIs for paperwork. PDF generation, e-signature and embeddable no-code webforms.
|
|
49
|
-
<br>
|
|
50
|
-
The easiest way to build paperwork automation into your product.
|
|
51
|
-
</sub>
|
|
52
|
-
</div>
|
|
53
|
+
<b>VPS hosting with taste 😛</b>
|
|
53
54
|
</a>
|
|
54
|
-
<a href="https://
|
|
55
|
+
<a href="https://dutchis.net/?ref=sindresorhus#gh-dark-mode-only">
|
|
55
56
|
<div>
|
|
56
|
-
<img src="https://sindresorhus.com/assets/thanks/
|
|
57
|
+
<img src="https://sindresorhus.com/assets/thanks/dutchis-logo-dark.png" width="200" alt="DutchIS">
|
|
57
58
|
</div>
|
|
58
59
|
<br>
|
|
59
|
-
<b>
|
|
60
|
-
<div>
|
|
61
|
-
<sub>
|
|
62
|
-
Easy APIs for paperwork. PDF generation, e-signature and embeddable no-code webforms.
|
|
63
|
-
<br>
|
|
64
|
-
The easiest way to build paperwork automation into your product.
|
|
65
|
-
</sub>
|
|
66
|
-
</div>
|
|
60
|
+
<b>VPS hosting with taste 😛</b>
|
|
67
61
|
</a>
|
|
68
62
|
<br>
|
|
69
63
|
<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
64
|
<br>
|
|
83
65
|
<br>
|
|
84
66
|
<br>
|
|
@@ -110,7 +92,9 @@ For browser usage, we recommend [Ky](https://github.com/sindresorhus/ky) by the
|
|
|
110
92
|
npm install got
|
|
111
93
|
```
|
|
112
94
|
|
|
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
|
|
95
|
+
**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.
|
|
96
|
+
|
|
97
|
+
**Got v11 (the previous major version) is no longer maintained and we will not accept any backport requests.**
|
|
114
98
|
|
|
115
99
|
## Take a peek
|
|
116
100
|
|
|
@@ -210,38 +194,38 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
210
194
|
|
|
211
195
|
## Comparison
|
|
212
196
|
|
|
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] | [![][
|
|
197
|
+
| | `got` | [`node-fetch`][n0] | [`ky`][k0] | [`axios`][a0] | [`superagent`][s0] |
|
|
198
|
+
|-----------------------|:-------------------:|:--------------------:|:------------------------:|:------------------:|:----------------------:|
|
|
199
|
+
| HTTP/2 support | :heavy_check_mark:¹ | :x: | :x: | :x: | :heavy_check_mark:\*\* |
|
|
200
|
+
| Browser support | :x: | :heavy_check_mark:\* | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
201
|
+
| Promise API | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
202
|
+
| Stream API | :heavy_check_mark: | Node.js only | :x: | :x: | :heavy_check_mark: |
|
|
203
|
+
| Pagination API | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
204
|
+
| Request cancelation | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
205
|
+
| RFC compliant caching | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
206
|
+
| Cookies (out-of-box) | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
207
|
+
| Follows redirects | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
208
|
+
| Retries on failure | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: | :heavy_check_mark: |
|
|
209
|
+
| Progress events | :heavy_check_mark: | :x: | :heavy_check_mark:\*\*\* | Browser only | :heavy_check_mark: |
|
|
210
|
+
| Handles gzip/deflate | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
211
|
+
| Advanced timeouts | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
212
|
+
| Timings | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
213
|
+
| Errors with metadata | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :x: |
|
|
214
|
+
| JSON mode | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
215
|
+
| Custom defaults | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :x: |
|
|
216
|
+
| Composable | :heavy_check_mark: | :x: | :x: | :x: | :heavy_check_mark: |
|
|
217
|
+
| Hooks | :heavy_check_mark: | :x: | :heavy_check_mark: | :heavy_check_mark: | :x: |
|
|
218
|
+
| Issues open | [![][gio]][g1] | [![][nio]][n1] | [![][kio]][k1] | [![][aio]][a1] | [![][sio]][s1] |
|
|
219
|
+
| Issues closed | [![][gic]][g2] | [![][nic]][n2] | [![][kic]][k2] | [![][aic]][a2] | [![][sic]][s2] |
|
|
220
|
+
| Downloads | [![][gd]][g3] | [![][nd]][n3] | [![][kd]][k3] | [![][ad]][a3] | [![][sd]][s3] |
|
|
221
|
+
| Coverage | TBD | [![][nc]][n4] | [![][kc]][k4] | [![][ac]][a4] | [![][sc]][s4] |
|
|
222
|
+
| Build | [![][gb]][g5] | [![][nb]][n5] | [![][kb]][k5] | [![][ab]][a5] | [![][sb]][s5] |
|
|
223
|
+
| Bugs | [![][gbg]][g6] | [![][nbg]][n6] | [![][kbg]][k6] | [![][abg]][a6] | [![][sbg]][s6] |
|
|
224
|
+
| Dependents | [![][gdp]][g7] | [![][ndp]][n7] | [![][kdp]][k7] | [![][adp]][a7] | [![][sdp]][s7] |
|
|
225
|
+
| Install size | [![][gis]][g8] | [![][nis]][n8] | [![][kis]][k8] | [![][ais]][a8] | [![][sis]][s8] |
|
|
226
|
+
| GitHub stars | [![][gs]][g9] | [![][ns]][n9] | [![][ks]][k9] | [![][as]][a9] | [![][ss]][s9] |
|
|
227
|
+
| TypeScript support | [![][gts]][g10] | [![][nts]][n10] | [![][kts]][k10] | [![][ats]][a10] | [![][sts]][s11] |
|
|
228
|
+
| Last commit | [![][glc]][g11] | [![][nlc]][n11] | [![][klc]][k11] | [![][alc]][a11] | [![][slc]][s11] |
|
|
245
229
|
|
|
246
230
|
\* It's almost API compatible with the browser `fetch` API.\
|
|
247
231
|
\*\* Need to switch the protocol manually. Doesn't accept PUSH streams and doesn't reuse HTTP/2 sessions.\
|
|
@@ -252,7 +236,6 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
252
236
|
|
|
253
237
|
<!-- GITHUB -->
|
|
254
238
|
[k0]: https://github.com/sindresorhus/ky
|
|
255
|
-
[r0]: https://github.com/request/request
|
|
256
239
|
[n0]: https://github.com/node-fetch/node-fetch
|
|
257
240
|
[a0]: https://github.com/axios/axios
|
|
258
241
|
[s0]: https://github.com/visionmedia/superagent
|
|
@@ -260,14 +243,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
260
243
|
<!-- ISSUES OPEN -->
|
|
261
244
|
[gio]: https://img.shields.io/github/issues-raw/sindresorhus/got?color=gray&label
|
|
262
245
|
[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
246
|
[nio]: https://img.shields.io/github/issues-raw/bitinn/node-fetch?color=gray&label
|
|
265
247
|
[aio]: https://img.shields.io/github/issues-raw/axios/axios?color=gray&label
|
|
266
248
|
[sio]: https://img.shields.io/github/issues-raw/visionmedia/superagent?color=gray&label
|
|
267
249
|
|
|
268
250
|
[g1]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
269
251
|
[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
252
|
[n1]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
272
253
|
[a1]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
273
254
|
[s1]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
|
@@ -275,14 +256,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
275
256
|
<!-- ISSUES CLOSED -->
|
|
276
257
|
[gic]: https://img.shields.io/github/issues-closed-raw/sindresorhus/got?color=blue&label
|
|
277
258
|
[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
259
|
[nic]: https://img.shields.io/github/issues-closed-raw/bitinn/node-fetch?color=blue&label
|
|
280
260
|
[aic]: https://img.shields.io/github/issues-closed-raw/axios/axios?color=blue&label
|
|
281
261
|
[sic]: https://img.shields.io/github/issues-closed-raw/visionmedia/superagent?color=blue&label
|
|
282
262
|
|
|
283
263
|
[g2]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
284
264
|
[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
265
|
[n2]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
287
266
|
[a2]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
288
267
|
[s2]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aclosed+sort%3Aupdated-desc
|
|
@@ -290,14 +269,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
290
269
|
<!-- DOWNLOADS -->
|
|
291
270
|
[gd]: https://img.shields.io/npm/dm/got?color=darkgreen&label
|
|
292
271
|
[kd]: https://img.shields.io/npm/dm/ky?color=darkgreen&label
|
|
293
|
-
[rd]: https://img.shields.io/npm/dm/request?color=darkgreen&label
|
|
294
272
|
[nd]: https://img.shields.io/npm/dm/node-fetch?color=darkgreen&label
|
|
295
273
|
[ad]: https://img.shields.io/npm/dm/axios?color=darkgreen&label
|
|
296
274
|
[sd]: https://img.shields.io/npm/dm/superagent?color=darkgreen&label
|
|
297
275
|
|
|
298
276
|
[g3]: https://www.npmjs.com/package/got
|
|
299
277
|
[k3]: https://www.npmjs.com/package/ky
|
|
300
|
-
[r3]: https://www.npmjs.com/package/request
|
|
301
278
|
[n3]: https://www.npmjs.com/package/node-fetch
|
|
302
279
|
[a3]: https://www.npmjs.com/package/axios
|
|
303
280
|
[s3]: https://www.npmjs.com/package/superagent
|
|
@@ -305,14 +282,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
305
282
|
<!-- COVERAGE -->
|
|
306
283
|
[gc]: https://img.shields.io/coveralls/github/sindresorhus/got?color=0b9062&label
|
|
307
284
|
[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
285
|
[nc]: https://img.shields.io/coveralls/github/bitinn/node-fetch?color=0b9062&label
|
|
310
286
|
[ac]: https://img.shields.io/coveralls/github/mzabriskie/axios?color=0b9062&label
|
|
311
287
|
[sc]: https://img.shields.io/codecov/c/github/visionmedia/superagent?color=0b9062&label
|
|
312
288
|
|
|
313
289
|
[g4]: https://coveralls.io/github/sindresorhus/got
|
|
314
290
|
[k4]: https://codecov.io/gh/sindresorhus/ky
|
|
315
|
-
[r4]: https://coveralls.io/github/request/request
|
|
316
291
|
[n4]: https://coveralls.io/github/bitinn/node-fetch
|
|
317
292
|
[a4]: https://coveralls.io/github/mzabriskie/axios
|
|
318
293
|
[s4]: https://codecov.io/gh/visionmedia/superagent
|
|
@@ -320,14 +295,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
320
295
|
<!-- BUILD -->
|
|
321
296
|
[gb]: https://github.com/sindresorhus/got/actions/workflows/main.yml/badge.svg
|
|
322
297
|
[kb]: https://github.com/sindresorhus/ky/actions/workflows/main.yml/badge.svg
|
|
323
|
-
[rb]: https://img.shields.io/travis/request/request?label
|
|
324
298
|
[nb]: https://img.shields.io/travis/bitinn/node-fetch?label
|
|
325
299
|
[ab]: https://img.shields.io/travis/axios/axios?label
|
|
326
300
|
[sb]: https://img.shields.io/travis/visionmedia/superagent?label
|
|
327
301
|
|
|
328
302
|
[g5]: https://github.com/sindresorhus/got/actions/workflows/main.yml
|
|
329
303
|
[k5]: https://github.com/sindresorhus/ky/actions/workflows/main.yml
|
|
330
|
-
[r5]: https://travis-ci.org/github/request/request
|
|
331
304
|
[n5]: https://travis-ci.org/github/bitinn/node-fetch
|
|
332
305
|
[a5]: https://travis-ci.org/github/axios/axios
|
|
333
306
|
[s5]: https://travis-ci.org/github/visionmedia/superagent
|
|
@@ -335,29 +308,25 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
335
308
|
<!-- BUGS -->
|
|
336
309
|
[gbg]: https://img.shields.io/github/issues-raw/sindresorhus/got/bug?color=darkred&label
|
|
337
310
|
[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
311
|
[nbg]: https://img.shields.io/github/issues-raw/bitinn/node-fetch/bug?color=darkred&label
|
|
340
|
-
[abg]: https://img.shields.io/github/issues-raw/axios/axios/
|
|
312
|
+
[abg]: https://img.shields.io/github/issues-raw/axios/axios/bug-fix?color=darkred&label
|
|
341
313
|
[sbg]: https://img.shields.io/github/issues-raw/visionmedia/superagent/Bug?color=darkred&label
|
|
342
314
|
|
|
343
315
|
[g6]: https://github.com/sindresorhus/got/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
|
|
344
316
|
[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
317
|
[n6]: https://github.com/bitinn/node-fetch/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug
|
|
347
|
-
[a6]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%
|
|
318
|
+
[a6]: https://github.com/axios/axios/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22bug-fix%22
|
|
348
319
|
[s6]: https://github.com/visionmedia/superagent/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ABug
|
|
349
320
|
|
|
350
321
|
<!-- DEPENDENTS -->
|
|
351
322
|
[gdp]: https://badgen.net/npm/dependents/got?color=orange&label
|
|
352
323
|
[kdp]: https://badgen.net/npm/dependents/ky?color=orange&label
|
|
353
|
-
[rdp]: https://badgen.net/npm/dependents/request?color=orange&label
|
|
354
324
|
[ndp]: https://badgen.net/npm/dependents/node-fetch?color=orange&label
|
|
355
325
|
[adp]: https://badgen.net/npm/dependents/axios?color=orange&label
|
|
356
326
|
[sdp]: https://badgen.net/npm/dependents/superagent?color=orange&label
|
|
357
327
|
|
|
358
328
|
[g7]: https://www.npmjs.com/package/got?activeTab=dependents
|
|
359
329
|
[k7]: https://www.npmjs.com/package/ky?activeTab=dependents
|
|
360
|
-
[r7]: https://www.npmjs.com/package/request?activeTab=dependents
|
|
361
330
|
[n7]: https://www.npmjs.com/package/node-fetch?activeTab=dependents
|
|
362
331
|
[a7]: https://www.npmjs.com/package/axios?activeTab=dependents
|
|
363
332
|
[s7]: https://www.npmjs.com/package/visionmedia?activeTab=dependents
|
|
@@ -365,14 +334,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
365
334
|
<!-- INSTALL SIZE -->
|
|
366
335
|
[gis]: https://badgen.net/packagephobia/install/got?color=blue&label
|
|
367
336
|
[kis]: https://badgen.net/packagephobia/install/ky?color=blue&label
|
|
368
|
-
[ris]: https://badgen.net/packagephobia/install/request?color=blue&label
|
|
369
337
|
[nis]: https://badgen.net/packagephobia/install/node-fetch?color=blue&label
|
|
370
338
|
[ais]: https://badgen.net/packagephobia/install/axios?color=blue&label
|
|
371
339
|
[sis]: https://badgen.net/packagephobia/install/superagent?color=blue&label
|
|
372
340
|
|
|
373
341
|
[g8]: https://packagephobia.com/result?p=got
|
|
374
342
|
[k8]: https://packagephobia.com/result?p=ky
|
|
375
|
-
[r8]: https://packagephobia.com/result?p=request
|
|
376
343
|
[n8]: https://packagephobia.com/result?p=node-fetch
|
|
377
344
|
[a8]: https://packagephobia.com/result?p=axios
|
|
378
345
|
[s8]: https://packagephobia.com/result?p=superagent
|
|
@@ -380,14 +347,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
380
347
|
<!-- GITHUB STARS -->
|
|
381
348
|
[gs]: https://img.shields.io/github/stars/sindresorhus/got?color=white&label
|
|
382
349
|
[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
350
|
[ns]: https://img.shields.io/github/stars/bitinn/node-fetch?color=white&label
|
|
385
351
|
[as]: https://img.shields.io/github/stars/axios/axios?color=white&label
|
|
386
352
|
[ss]: https://img.shields.io/github/stars/visionmedia/superagent?color=white&label
|
|
387
353
|
|
|
388
354
|
[g9]: https://github.com/sindresorhus/got
|
|
389
355
|
[k9]: https://github.com/sindresorhus/ky
|
|
390
|
-
[r9]: https://github.com/request/request
|
|
391
356
|
[n9]: https://github.com/node-fetch/node-fetch
|
|
392
357
|
[a9]: https://github.com/axios/axios
|
|
393
358
|
[s9]: https://github.com/visionmedia/superagent
|
|
@@ -395,14 +360,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
395
360
|
<!-- TYPESCRIPT SUPPORT -->
|
|
396
361
|
[gts]: https://badgen.net/npm/types/got?label
|
|
397
362
|
[kts]: https://badgen.net/npm/types/ky?label
|
|
398
|
-
[rts]: https://badgen.net/npm/types/request?label
|
|
399
363
|
[nts]: https://badgen.net/npm/types/node-fetch?label
|
|
400
364
|
[ats]: https://badgen.net/npm/types/axios?label
|
|
401
365
|
[sts]: https://badgen.net/npm/types/superagent?label
|
|
402
366
|
|
|
403
367
|
[g10]: https://github.com/sindresorhus/got
|
|
404
368
|
[k10]: https://github.com/sindresorhus/ky
|
|
405
|
-
[r10]: https://github.com/request/request
|
|
406
369
|
[n10]: https://github.com/node-fetch/node-fetch
|
|
407
370
|
[a10]: https://github.com/axios/axios
|
|
408
371
|
[s10]: https://github.com/visionmedia/superagent
|
|
@@ -410,14 +373,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
410
373
|
<!-- LAST COMMIT -->
|
|
411
374
|
[glc]: https://img.shields.io/github/last-commit/sindresorhus/got?color=gray&label
|
|
412
375
|
[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
376
|
[nlc]: https://img.shields.io/github/last-commit/bitinn/node-fetch?color=gray&label
|
|
415
377
|
[alc]: https://img.shields.io/github/last-commit/axios/axios?color=gray&label
|
|
416
378
|
[slc]: https://img.shields.io/github/last-commit/visionmedia/superagent?color=gray&label
|
|
417
379
|
|
|
418
380
|
[g11]: https://github.com/sindresorhus/got/commits
|
|
419
381
|
[k11]: https://github.com/sindresorhus/ky/commits
|
|
420
|
-
[r11]: https://github.com/request/request/commits
|
|
421
382
|
[n11]: https://github.com/node-fetch/node-fetch/commits
|
|
422
383
|
[a11]: https://github.com/axios/axios/commits
|
|
423
384
|
[s11]: https://github.com/visionmedia/superagent/commits
|