got 14.4.1 → 14.4.3
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/as-promise/types.d.ts +0 -1
- package/dist/source/core/errors.d.ts +0 -1
- package/dist/source/core/index.d.ts +0 -5
- package/dist/source/core/index.js +6 -9
- package/dist/source/core/options.d.ts +12 -20
- package/dist/source/core/options.js +12 -12
- package/dist/source/core/response.d.ts +1 -2
- package/dist/source/core/timed-out.d.ts +0 -1
- package/dist/source/core/utils/get-body-size.d.ts +0 -1
- package/dist/source/core/utils/is-client-request.d.ts +0 -2
- package/dist/source/core/utils/is-form-data.d.ts +0 -1
- package/dist/source/core/utils/is-form-data.js +1 -1
- package/dist/source/core/utils/proxy-events.d.ts +0 -1
- package/dist/source/core/utils/unhandle.d.ts +0 -1
- package/dist/source/core/utils/url-to-options.d.ts +0 -1
- package/dist/source/create.js +9 -12
- package/dist/source/types.d.ts +0 -1
- package/package.json +17 -17
- package/readme.md +33 -55
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
4
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
5
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
6
1
|
import { Duplex } from 'node:stream';
|
|
7
2
|
import { type ClientRequest } from 'node:http';
|
|
8
3
|
import type { Socket } from 'node:net';
|
|
@@ -5,8 +5,7 @@ import http, { ServerResponse } from 'node:http';
|
|
|
5
5
|
import timer from '@szmarczak/http-timer';
|
|
6
6
|
import CacheableRequest, { CacheError as CacheableCacheError, } from 'cacheable-request';
|
|
7
7
|
import decompressResponse from 'decompress-response';
|
|
8
|
-
import is from '@sindresorhus/is';
|
|
9
|
-
import { getStreamAsBuffer } from 'get-stream';
|
|
8
|
+
import is, { isBuffer } from '@sindresorhus/is';
|
|
10
9
|
import { FormDataEncoder, isFormData as isFormDataLike } from 'form-data-encoder';
|
|
11
10
|
import getBodySize from './utils/get-body-size.js';
|
|
12
11
|
import isFormData from './utils/is-form-data.js';
|
|
@@ -627,10 +626,8 @@ export default class Request extends Duplex {
|
|
|
627
626
|
}
|
|
628
627
|
try {
|
|
629
628
|
// Errors are emitted via the `error` event
|
|
630
|
-
const
|
|
631
|
-
|
|
632
|
-
// let rawBody = await from.toArray();
|
|
633
|
-
// rawBody = Buffer.concat(rawBody);
|
|
629
|
+
const fromArray = await from.toArray();
|
|
630
|
+
const rawBody = isBuffer(fromArray.at(0)) ? Buffer.concat(fromArray) : Buffer.from(fromArray.join(''));
|
|
634
631
|
// On retry Request is destroyed with no error, therefore the above will successfully resolve.
|
|
635
632
|
// So in order to check if this was really successfull, we need to check if it has been properly ended.
|
|
636
633
|
if (!this.isAborted) {
|
|
@@ -735,13 +732,13 @@ export default class Request extends Duplex {
|
|
|
735
732
|
}
|
|
736
733
|
})();
|
|
737
734
|
}
|
|
738
|
-
else if (event === 'abort') {
|
|
735
|
+
else if (event === 'abort' || event === 'destroy') {
|
|
739
736
|
// The empty catch is needed here in case when
|
|
740
737
|
// it rejects before it's `await`ed in `_makeRequest`.
|
|
741
738
|
(async () => {
|
|
742
739
|
try {
|
|
743
740
|
const request = (await result);
|
|
744
|
-
request.once(
|
|
741
|
+
request.once(event, handler);
|
|
745
742
|
}
|
|
746
743
|
catch { }
|
|
747
744
|
})();
|
|
@@ -794,7 +791,7 @@ export default class Request extends Duplex {
|
|
|
794
791
|
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
795
792
|
delete headers[key];
|
|
796
793
|
}
|
|
797
|
-
else if (is.
|
|
794
|
+
else if (is.null(headers[key])) {
|
|
798
795
|
throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${key}\` header`);
|
|
799
796
|
}
|
|
800
797
|
}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
4
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
5
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
6
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
7
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
8
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
9
1
|
import type { Buffer } from 'node:buffer';
|
|
10
2
|
import { checkServerIdentity, type SecureContextOptions, type DetailedPeerCertificate } from 'node:tls';
|
|
11
3
|
import https, { type RequestOptions as HttpsRequestOptions, type Agent as HttpsAgent } from 'node:https';
|
|
@@ -1139,7 +1131,7 @@ export default class Options {
|
|
|
1139
1131
|
h2session: http2wrapper.ClientHttp2Session | undefined;
|
|
1140
1132
|
decompress: boolean;
|
|
1141
1133
|
prefixUrl: string | URL;
|
|
1142
|
-
body: string | Readable | Buffer | Generator<unknown, any,
|
|
1134
|
+
body: string | Readable | Buffer | Generator<unknown, any, any> | AsyncGenerator<unknown, any, any> | FormDataLike | undefined;
|
|
1143
1135
|
form: Record<string, any> | undefined;
|
|
1144
1136
|
url: string | URL | undefined;
|
|
1145
1137
|
cookieJar: PromiseCookieJar | ToughCookieJar | undefined;
|
|
@@ -1151,7 +1143,7 @@ export default class Options {
|
|
|
1151
1143
|
(hostname: string, callback: (error: NodeJS.ErrnoException | null, address: string, family: import("cacheable-lookup").IPFamily) => void): void;
|
|
1152
1144
|
(hostname: string, options: import("cacheable-lookup").LookupOptions & {
|
|
1153
1145
|
all: true;
|
|
1154
|
-
}, callback: (error: NodeJS.ErrnoException | null, result:
|
|
1146
|
+
}, callback: (error: NodeJS.ErrnoException | null, result: ReadonlyArray<import("cacheable-lookup").EntryObject>) => void): void;
|
|
1155
1147
|
(hostname: string, options: import("cacheable-lookup").LookupOptions, callback: (error: NodeJS.ErrnoException | null, address: string, family: import("cacheable-lookup").IPFamily) => void): void;
|
|
1156
1148
|
} | undefined;
|
|
1157
1149
|
dnsCache: boolean | CacheableLookup | undefined;
|
|
@@ -1203,7 +1195,7 @@ export default class Options {
|
|
|
1203
1195
|
(hostname: string, callback: (error: NodeJS.ErrnoException | null, address: string, family: import("cacheable-lookup").IPFamily) => void): void;
|
|
1204
1196
|
(hostname: string, options: import("cacheable-lookup").LookupOptions & {
|
|
1205
1197
|
all: true;
|
|
1206
|
-
}, callback: (error: NodeJS.ErrnoException | null, result:
|
|
1198
|
+
}, callback: (error: NodeJS.ErrnoException | null, result: ReadonlyArray<import("cacheable-lookup").EntryObject>) => void): void;
|
|
1207
1199
|
(hostname: string, options: import("cacheable-lookup").LookupOptions, callback: (error: NodeJS.ErrnoException | null, address: string, family: import("cacheable-lookup").IPFamily) => void): void;
|
|
1208
1200
|
} | undefined;
|
|
1209
1201
|
family: DnsLookupIpVersion;
|
|
@@ -1218,19 +1210,19 @@ export default class Options {
|
|
|
1218
1210
|
h2session: http2wrapper.ClientHttp2Session | undefined;
|
|
1219
1211
|
_defaultAgent?: http.Agent | undefined;
|
|
1220
1212
|
auth?: string | null | undefined;
|
|
1221
|
-
defaultPort?:
|
|
1222
|
-
hints?:
|
|
1213
|
+
defaultPort?: number | string | undefined;
|
|
1214
|
+
hints?: import("dns").LookupOptions["hints"];
|
|
1223
1215
|
host?: string | null | undefined;
|
|
1224
1216
|
hostname?: string | null | undefined;
|
|
1225
1217
|
insecureHTTPParser?: boolean | undefined;
|
|
1226
1218
|
localPort?: number | undefined;
|
|
1227
1219
|
path?: string | null | undefined;
|
|
1228
|
-
port?:
|
|
1220
|
+
port?: number | string | null | undefined;
|
|
1229
1221
|
protocol?: string | null | undefined;
|
|
1230
1222
|
signal?: AbortSignal | undefined;
|
|
1231
1223
|
socketPath?: string | undefined;
|
|
1232
|
-
uniqueHeaders?:
|
|
1233
|
-
joinDuplicateHeaders?: boolean
|
|
1224
|
+
uniqueHeaders?: Array<string | string[]> | undefined;
|
|
1225
|
+
joinDuplicateHeaders?: boolean;
|
|
1234
1226
|
ALPNCallback?: ((arg: {
|
|
1235
1227
|
servername: string;
|
|
1236
1228
|
protocols: string[];
|
|
@@ -1243,10 +1235,10 @@ export default class Options {
|
|
|
1243
1235
|
sessionIdContext?: string | undefined;
|
|
1244
1236
|
ticketKeys?: Buffer | undefined;
|
|
1245
1237
|
servername?: string | undefined;
|
|
1246
|
-
shared?: boolean
|
|
1247
|
-
cacheHeuristic?: number
|
|
1248
|
-
immutableMinTimeToLive?: number
|
|
1249
|
-
ignoreCargoCult?: boolean
|
|
1238
|
+
shared?: boolean;
|
|
1239
|
+
cacheHeuristic?: number;
|
|
1240
|
+
immutableMinTimeToLive?: number;
|
|
1241
|
+
ignoreCargoCult?: boolean;
|
|
1250
1242
|
};
|
|
1251
1243
|
getRequestFunction(): RequestFunction | typeof https.request | undefined;
|
|
1252
1244
|
getFallbackRequestFunction(): RequestFunction | typeof https.request | undefined;
|
|
@@ -15,7 +15,7 @@ function validateSearchParameters(searchParameters) {
|
|
|
15
15
|
// eslint-disable-next-line guard-for-in
|
|
16
16
|
for (const key in searchParameters) {
|
|
17
17
|
const value = searchParameters[key];
|
|
18
|
-
assert.any([is.string, is.number, is.boolean, is.
|
|
18
|
+
assert.any([is.string, is.number, is.boolean, is.null, is.undefined], value);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
const globalCache = new Map();
|
|
@@ -413,7 +413,7 @@ export default class Options {
|
|
|
413
413
|
return this._internals.request;
|
|
414
414
|
}
|
|
415
415
|
set request(value) {
|
|
416
|
-
assert.any([is.
|
|
416
|
+
assert.any([is.function, is.undefined], value);
|
|
417
417
|
this._internals.request = value;
|
|
418
418
|
}
|
|
419
419
|
/**
|
|
@@ -730,8 +730,8 @@ export default class Options {
|
|
|
730
730
|
return;
|
|
731
731
|
}
|
|
732
732
|
let { setCookie, getCookieString } = value;
|
|
733
|
-
assert.
|
|
734
|
-
assert.
|
|
733
|
+
assert.function(setCookie);
|
|
734
|
+
assert.function(getCookieString);
|
|
735
735
|
/* istanbul ignore next: Horrible `tough-cookie` v3 check */
|
|
736
736
|
if (setCookie.length === 4 && getCookieString.length === 0) {
|
|
737
737
|
setCookie = promisify(setCookie.bind(value));
|
|
@@ -871,7 +871,7 @@ export default class Options {
|
|
|
871
871
|
return this._internals.dnsLookup;
|
|
872
872
|
}
|
|
873
873
|
set dnsLookup(value) {
|
|
874
|
-
assert.any([is.
|
|
874
|
+
assert.any([is.function, is.undefined], value);
|
|
875
875
|
this._internals.dnsLookup = value;
|
|
876
876
|
}
|
|
877
877
|
/**
|
|
@@ -961,7 +961,7 @@ export default class Options {
|
|
|
961
961
|
assert.any([is.array, is.undefined], hooks);
|
|
962
962
|
if (hooks) {
|
|
963
963
|
for (const hook of hooks) {
|
|
964
|
-
assert.
|
|
964
|
+
assert.function(hook);
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
967
|
if (this._merging) {
|
|
@@ -993,7 +993,7 @@ export default class Options {
|
|
|
993
993
|
return this._internals.followRedirect;
|
|
994
994
|
}
|
|
995
995
|
set followRedirect(value) {
|
|
996
|
-
assert.any([is.boolean, is.
|
|
996
|
+
assert.any([is.boolean, is.function], value);
|
|
997
997
|
this._internals.followRedirect = value;
|
|
998
998
|
}
|
|
999
999
|
get followRedirects() {
|
|
@@ -1199,7 +1199,7 @@ export default class Options {
|
|
|
1199
1199
|
return this._internals.parseJson;
|
|
1200
1200
|
}
|
|
1201
1201
|
set parseJson(value) {
|
|
1202
|
-
assert.
|
|
1202
|
+
assert.function(value);
|
|
1203
1203
|
this._internals.parseJson = value;
|
|
1204
1204
|
}
|
|
1205
1205
|
/**
|
|
@@ -1247,7 +1247,7 @@ export default class Options {
|
|
|
1247
1247
|
return this._internals.stringifyJson;
|
|
1248
1248
|
}
|
|
1249
1249
|
set stringifyJson(value) {
|
|
1250
|
-
assert.
|
|
1250
|
+
assert.function(value);
|
|
1251
1251
|
this._internals.stringifyJson = value;
|
|
1252
1252
|
}
|
|
1253
1253
|
/**
|
|
@@ -1277,7 +1277,7 @@ export default class Options {
|
|
|
1277
1277
|
}
|
|
1278
1278
|
set retry(value) {
|
|
1279
1279
|
assert.plainObject(value);
|
|
1280
|
-
assert.any([is.
|
|
1280
|
+
assert.any([is.function, is.undefined], value.calculateDelay);
|
|
1281
1281
|
assert.any([is.number, is.undefined], value.maxRetryAfter);
|
|
1282
1282
|
assert.any([is.number, is.undefined], value.limit);
|
|
1283
1283
|
assert.any([is.array, is.undefined], value.methods);
|
|
@@ -1331,7 +1331,7 @@ export default class Options {
|
|
|
1331
1331
|
return this._internals.createConnection;
|
|
1332
1332
|
}
|
|
1333
1333
|
set createConnection(value) {
|
|
1334
|
-
assert.any([is.
|
|
1334
|
+
assert.any([is.function, is.undefined], value);
|
|
1335
1335
|
this._internals.createConnection = value;
|
|
1336
1336
|
}
|
|
1337
1337
|
/**
|
|
@@ -1369,7 +1369,7 @@ export default class Options {
|
|
|
1369
1369
|
set https(value) {
|
|
1370
1370
|
assert.plainObject(value);
|
|
1371
1371
|
assert.any([is.boolean, is.undefined], value.rejectUnauthorized);
|
|
1372
|
-
assert.any([is.
|
|
1372
|
+
assert.any([is.function, is.undefined], value.checkServerIdentity);
|
|
1373
1373
|
assert.any([is.string, is.object, is.array, is.undefined], value.certificateAuthority);
|
|
1374
1374
|
assert.any([is.string, is.object, is.array, is.undefined], value.key);
|
|
1375
1375
|
assert.any([is.string, is.object, is.array, is.undefined], value.certificate);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
1
|
import type { Buffer } from 'node:buffer';
|
|
3
2
|
import type { IncomingMessageWithTimings, Timings } from '@szmarczak/http-timer';
|
|
4
3
|
import { RequestError } from './errors.js';
|
|
@@ -22,7 +21,7 @@ export type PlainResponse = {
|
|
|
22
21
|
/**
|
|
23
22
|
The remote IP address.
|
|
24
23
|
|
|
25
|
-
This is hopefully a temporary limitation, see [lukechilds/cacheable-request#86](https://github.com/
|
|
24
|
+
This is hopefully a temporary limitation, see [lukechilds/cacheable-request#86](https://web.archive.org/web/20220804165050/https://github.com/jaredwray/cacheable-request/issues/86).
|
|
26
25
|
|
|
27
26
|
__Note__: Not available when the response is cached.
|
|
28
27
|
*/
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Writable, Readable } from 'node:stream';
|
|
4
2
|
import type { ClientRequest } from 'node:http';
|
|
5
3
|
declare function isClientRequest(clientRequest: Writable | Readable): clientRequest is ClientRequest;
|
package/dist/source/create.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
1
2
|
import is, { assert } from '@sindresorhus/is';
|
|
2
3
|
import asPromise from './as-promise/index.js';
|
|
3
4
|
import Request from './core/index.js';
|
|
4
5
|
import Options from './core/options.js';
|
|
5
|
-
|
|
6
|
-
const delay = async (ms) => new Promise(resolve => {
|
|
7
|
-
setTimeout(resolve, ms);
|
|
8
|
-
});
|
|
9
|
-
const isGotInstance = (value) => is.function_(value);
|
|
6
|
+
const isGotInstance = (value) => is.function(value);
|
|
10
7
|
const aliases = [
|
|
11
8
|
'get',
|
|
12
9
|
'post',
|
|
@@ -33,9 +30,9 @@ const create = (defaults) => {
|
|
|
33
30
|
const lastHandler = (normalized) => {
|
|
34
31
|
// Note: `options` is `undefined` when `new Options(...)` fails
|
|
35
32
|
request.options = normalized;
|
|
36
|
-
request._noPipe = !normalized
|
|
33
|
+
request._noPipe = !normalized?.isStream;
|
|
37
34
|
void request.flush();
|
|
38
|
-
if (normalized
|
|
35
|
+
if (normalized?.isStream) {
|
|
39
36
|
return request;
|
|
40
37
|
}
|
|
41
38
|
promise ||= asPromise(request);
|
|
@@ -45,7 +42,7 @@ const create = (defaults) => {
|
|
|
45
42
|
const iterateHandlers = (newOptions) => {
|
|
46
43
|
const handler = defaults.handlers[iteration++] ?? lastHandler;
|
|
47
44
|
const result = handler(newOptions, iterateHandlers);
|
|
48
|
-
if (is.promise(result) && !request.options
|
|
45
|
+
if (is.promise(result) && !request.options?.isStream) {
|
|
49
46
|
promise ||= asPromise(request);
|
|
50
47
|
if (result !== promise) {
|
|
51
48
|
const descriptors = Object.getOwnPropertyDescriptors(promise);
|
|
@@ -93,10 +90,10 @@ const create = (defaults) => {
|
|
|
93
90
|
let normalizedOptions = new Options(url, options, defaults.options);
|
|
94
91
|
normalizedOptions.resolveBodyOnly = false;
|
|
95
92
|
const { pagination } = normalizedOptions;
|
|
96
|
-
assert.
|
|
97
|
-
assert.
|
|
98
|
-
assert.
|
|
99
|
-
assert.
|
|
93
|
+
assert.function(pagination.transform);
|
|
94
|
+
assert.function(pagination.shouldContinue);
|
|
95
|
+
assert.function(pagination.filter);
|
|
96
|
+
assert.function(pagination.paginate);
|
|
100
97
|
assert.number(pagination.countLimit);
|
|
101
98
|
assert.number(pagination.requestLimit);
|
|
102
99
|
assert.number(pagination.backoff);
|
package/dist/source/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "got",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.3",
|
|
4
4
|
"description": "Human-friendly and powerful HTTP request library for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/got",
|
|
@@ -48,60 +48,60 @@
|
|
|
48
48
|
"ky"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@sindresorhus/is": "^
|
|
51
|
+
"@sindresorhus/is": "^7.0.1",
|
|
52
52
|
"@szmarczak/http-timer": "^5.0.1",
|
|
53
53
|
"cacheable-lookup": "^7.0.0",
|
|
54
54
|
"cacheable-request": "^12.0.1",
|
|
55
55
|
"decompress-response": "^6.0.0",
|
|
56
56
|
"form-data-encoder": "^4.0.2",
|
|
57
|
-
"get-stream": "^8.0.1",
|
|
58
57
|
"http2-wrapper": "^2.2.1",
|
|
59
58
|
"lowercase-keys": "^3.0.0",
|
|
60
59
|
"p-cancelable": "^4.0.1",
|
|
61
60
|
"responselike": "^3.0.0",
|
|
62
|
-
"type-fest": "^4.
|
|
61
|
+
"type-fest": "^4.26.1"
|
|
63
62
|
},
|
|
64
63
|
"devDependencies": {
|
|
65
64
|
"@hapi/bourne": "^3.0.0",
|
|
66
|
-
"@sindresorhus/tsconfig": "^
|
|
65
|
+
"@sindresorhus/tsconfig": "^6.0.0",
|
|
67
66
|
"@sinonjs/fake-timers": "^11.2.2",
|
|
68
67
|
"@types/benchmark": "^2.1.5",
|
|
69
|
-
"@types/express": "^
|
|
70
|
-
"@types/node": "^
|
|
68
|
+
"@types/express": "^5.0.0",
|
|
69
|
+
"@types/node": "^22.7.5",
|
|
71
70
|
"@types/pem": "^1.14.4",
|
|
72
71
|
"@types/readable-stream": "^4.0.14",
|
|
73
72
|
"@types/request": "^2.48.12",
|
|
74
73
|
"@types/sinon": "^17.0.2",
|
|
75
74
|
"@types/sinonjs__fake-timers": "^8.1.5",
|
|
76
75
|
"ava": "^5.3.1",
|
|
77
|
-
"axios": "^1.
|
|
76
|
+
"axios": "^1.7.7",
|
|
78
77
|
"benchmark": "^2.1.4",
|
|
79
78
|
"bluebird": "^3.7.2",
|
|
80
|
-
"body-parser": "^1.20.
|
|
79
|
+
"body-parser": "^1.20.3",
|
|
81
80
|
"create-cert": "^1.0.6",
|
|
82
81
|
"create-test-server": "^3.0.1",
|
|
83
|
-
"del-cli": "^
|
|
82
|
+
"del-cli": "^6.0.0",
|
|
84
83
|
"delay": "^6.0.0",
|
|
85
|
-
"expect-type": "^0.
|
|
86
|
-
"express": "^4.
|
|
84
|
+
"expect-type": "^1.0.0",
|
|
85
|
+
"express": "^4.21.1",
|
|
87
86
|
"form-data": "^4.0.0",
|
|
88
87
|
"formdata-node": "^6.0.3",
|
|
89
|
-
"
|
|
88
|
+
"get-stream": "^9.0.1",
|
|
89
|
+
"nock": "^13.5.5",
|
|
90
90
|
"node-fetch": "^3.3.2",
|
|
91
91
|
"np": "^10.0.5",
|
|
92
|
-
"nyc": "^
|
|
92
|
+
"nyc": "^17.1.0",
|
|
93
93
|
"p-event": "^6.0.1",
|
|
94
94
|
"pem": "^1.14.8",
|
|
95
95
|
"pify": "^6.1.0",
|
|
96
96
|
"readable-stream": "^4.4.2",
|
|
97
97
|
"request": "^2.88.2",
|
|
98
|
-
"sinon": "^
|
|
98
|
+
"sinon": "^19.0.2",
|
|
99
99
|
"slow-stream": "0.0.4",
|
|
100
100
|
"tempy": "^3.1.0",
|
|
101
101
|
"then-busboy": "^5.2.1",
|
|
102
102
|
"tough-cookie": "^4.1.4",
|
|
103
|
-
"tsx": "^4.
|
|
104
|
-
"typescript": "^5.
|
|
103
|
+
"tsx": "^4.19.1",
|
|
104
|
+
"typescript": "^5.6.3",
|
|
105
105
|
"xo": "^0.56.0"
|
|
106
106
|
},
|
|
107
107
|
"ava": {
|
package/readme.md
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
<br>
|
|
6
6
|
<br>
|
|
7
7
|
<br>
|
|
8
|
+
<br>
|
|
9
|
+
<hr>
|
|
8
10
|
<p>
|
|
9
11
|
<p>
|
|
10
12
|
<sup>
|
|
@@ -13,41 +15,6 @@
|
|
|
13
15
|
</p>
|
|
14
16
|
<br>
|
|
15
17
|
<br>
|
|
16
|
-
<a href="https://retool.com/?utm_campaign=sindresorhus">
|
|
17
|
-
<img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="220">
|
|
18
|
-
</a>
|
|
19
|
-
<br>
|
|
20
|
-
<br>
|
|
21
|
-
<br>
|
|
22
|
-
<a href="https://strapi.io/?ref=sindresorhus">
|
|
23
|
-
<div>
|
|
24
|
-
<img src="https://sindresorhus.com/assets/thanks/strapi-logo-white-bg.png" width="200" alt="Strapi">
|
|
25
|
-
</div>
|
|
26
|
-
<b>Strapi is the leading open-source headless CMS.</b>
|
|
27
|
-
<div>
|
|
28
|
-
<sup>It’s 100% JavaScript, fully customizable, and developer-first.</sup>
|
|
29
|
-
</div>
|
|
30
|
-
</a>
|
|
31
|
-
<br>
|
|
32
|
-
<br>
|
|
33
|
-
<br>
|
|
34
|
-
<a href="https://serpapi.com#gh-light-mode-only">
|
|
35
|
-
<div>
|
|
36
|
-
<img src="https://sindresorhus.com/assets/thanks/serpapi-logo-light.svg" width="130" alt="SerpApi">
|
|
37
|
-
</div>
|
|
38
|
-
<b>API to get search engine results with ease.</b>
|
|
39
|
-
</a>
|
|
40
|
-
<a href="https://serpapi.com#gh-dark-mode-only">
|
|
41
|
-
<div>
|
|
42
|
-
<img src="https://sindresorhus.com/assets/thanks/serpapi-logo-dark.svg" width="120" alt="SerpApi">
|
|
43
|
-
</div>
|
|
44
|
-
<b>API to get search engine results with ease.</b>
|
|
45
|
-
</a>
|
|
46
|
-
<br>
|
|
47
|
-
<br>
|
|
48
|
-
<br>
|
|
49
|
-
<br>
|
|
50
|
-
<br>
|
|
51
18
|
<a href="https://www.fame.fi#gh-light-mode-only">
|
|
52
19
|
<img src="https://sindresorhus.com/assets/thanks/fame-logo-light.svg" width="200" alt="Fame Helsinki">
|
|
53
20
|
</a>
|
|
@@ -58,8 +25,28 @@
|
|
|
58
25
|
<br>
|
|
59
26
|
<br>
|
|
60
27
|
<br>
|
|
61
|
-
<
|
|
28
|
+
<a href="https://encore.dev?utm_campaign=github_repo&utm_medium=referral&utm_content=sindre&utm_source=github">
|
|
29
|
+
<div>
|
|
30
|
+
<picture>
|
|
31
|
+
<source width="230" media="(prefers-color-scheme: dark)" srcset="https://sindresorhus.com/assets/thanks/encore-logo-dark.svg">
|
|
32
|
+
<source width="230" media="(prefers-color-scheme: light)" srcset="https://sindresorhus.com/assets/thanks/encore-logo-light.svg">
|
|
33
|
+
<img width="230" src="https://sindresorhus.com/assets/thanks/encore-logo-light.svg" alt="Encore logo">
|
|
34
|
+
</picture>
|
|
35
|
+
</div>
|
|
36
|
+
<b>The development platform for building type-safe distributed systems</b>
|
|
37
|
+
<div>
|
|
38
|
+
<sup>End-to-end tooling from local development to automated DevOps and infrastructure in your AWS/GCP.</sup>
|
|
39
|
+
</div>
|
|
40
|
+
<br>
|
|
41
|
+
<br>
|
|
42
|
+
</a>
|
|
62
43
|
</p>
|
|
44
|
+
<hr>
|
|
45
|
+
<br>
|
|
46
|
+
<br>
|
|
47
|
+
<br>
|
|
48
|
+
<br>
|
|
49
|
+
<br>
|
|
63
50
|
<br>
|
|
64
51
|
<br>
|
|
65
52
|
</div>
|
|
@@ -185,14 +172,14 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
185
172
|
|
|
186
173
|
| | `got` | [`node-fetch`][n0] | [`ky`][k0] | [`axios`][a0] | [`superagent`][s0] |
|
|
187
174
|
|-----------------------|:-------------------:|:--------------------:|:------------------------:|:------------------:|:----------------------:|
|
|
188
|
-
| HTTP/2 support | :heavy_check_mark:¹ | :x: | :
|
|
175
|
+
| HTTP/2 support | :heavy_check_mark:¹ | :x: | :heavy_check_mark: | :x: | :heavy_check_mark:\*\* |
|
|
189
176
|
| Browser support | :x: | :heavy_check_mark:\* | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
190
177
|
| Promise API | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
191
178
|
| Stream API | :heavy_check_mark: | Node.js only | :x: | :x: | :heavy_check_mark: |
|
|
192
179
|
| Pagination API | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
193
180
|
| Request cancelation | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
194
181
|
| RFC compliant caching | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
195
|
-
| Cookies (out-of-the-box)
|
|
182
|
+
| Cookies (out-of-the-box) | :heavy_check_mark: | :x: | :x: | :x: | :x: |
|
|
196
183
|
| Follows redirects | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
|
|
197
184
|
| Retries on failure | :heavy_check_mark: | :x: | :heavy_check_mark: | :x: | :heavy_check_mark: |
|
|
198
185
|
| Progress events | :heavy_check_mark: | :x: | :heavy_check_mark:\*\*\* | Browser only | :heavy_check_mark: |
|
|
@@ -321,11 +308,11 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
321
308
|
[s7]: https://www.npmjs.com/package/visionmedia?activeTab=dependents
|
|
322
309
|
|
|
323
310
|
<!-- INSTALL SIZE -->
|
|
324
|
-
[gis]: https://
|
|
325
|
-
[kis]: https://
|
|
326
|
-
[nis]: https://
|
|
327
|
-
[ais]: https://
|
|
328
|
-
[sis]: https://
|
|
311
|
+
[gis]: https://packagephobia.com/badge?p=got
|
|
312
|
+
[kis]: https://packagephobia.com/badge?p=ky
|
|
313
|
+
[nis]: https://packagephobia.com/badge?p=node-fetch
|
|
314
|
+
[ais]: https://packagephobia.com/badge?p=axios
|
|
315
|
+
[sis]: https://packagephobia.com/badge?p=superagent
|
|
329
316
|
|
|
330
317
|
[g8]: https://packagephobia.com/result?p=got
|
|
331
318
|
[k8]: https://packagephobia.com/result?p=ky
|
|
@@ -374,7 +361,7 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
374
361
|
|
|
375
362
|
[Click here][InstallSizeOfTheDependencies] to see the install size of the Got dependencies.
|
|
376
363
|
|
|
377
|
-
[InstallSizeOfTheDependencies]: https://packagephobia.com/result?p=@sindresorhus/is@
|
|
364
|
+
[InstallSizeOfTheDependencies]: https://packagephobia.com/result?p=@sindresorhus/is@7.0.0,@szmarczak/http-timer@5.0.1,cacheable-lookup@7.0.0,cacheable-request@12.0.1,decompress-response@6.0.0,form-data-encoder@4.0.2,http2-wrapper@2.2.1,lowercase-keys@3.0.0,p-cancelable@4.0.1,responselike@3.0.0,type-fest@4.19.0
|
|
378
365
|
|
|
379
366
|
## Maintainers
|
|
380
367
|
|
|
@@ -412,12 +399,12 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
412
399
|
<tr>
|
|
413
400
|
<td align="center">
|
|
414
401
|
<a href="http://karaokes.moe">
|
|
415
|
-
<img width="140" valign="middle" src="https://
|
|
402
|
+
<img width="140" valign="middle" src="https://karaokes.moe/assets/images/index.png">
|
|
416
403
|
</a>
|
|
417
404
|
</td>
|
|
418
405
|
<td align="center">
|
|
419
406
|
<a href="https://github.com/renovatebot/renovate">
|
|
420
|
-
<img width="150" valign="middle" src="https://
|
|
407
|
+
<img width="150" valign="middle" src="https://avatars.githubusercontent.com/u/38656520?s=200&v=4">
|
|
421
408
|
</a>
|
|
422
409
|
</td>
|
|
423
410
|
<td align="center">
|
|
@@ -442,11 +429,6 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
442
429
|
<img width="150" valign="middle" src="https://user-images.githubusercontent.com/29518613/91814036-97fb9500-ec44-11ea-8c6c-d198cc23ca29.png">
|
|
443
430
|
</a>
|
|
444
431
|
</td>
|
|
445
|
-
<td align="center">
|
|
446
|
-
<a href="https://apify.com">
|
|
447
|
-
<img width="150" valign="middle" src="https://user-images.githubusercontent.com/23726914/128673143-958b5930-b677-40ef-8087-5698a0c29c45.png">
|
|
448
|
-
</a>
|
|
449
|
-
</td>
|
|
450
432
|
</tr>
|
|
451
433
|
</tbody>
|
|
452
434
|
</table>
|
|
@@ -496,7 +478,3 @@ By default, Got will retry on failure. To disable this option, set [`options.ret
|
|
|
496
478
|
> We’re using Got at Radity. Thanks for such an amazing work!
|
|
497
479
|
>
|
|
498
480
|
> — <a href="https://github.com/MirzayevFarid">Mirzayev Farid</a>
|
|
499
|
-
|
|
500
|
-
> Got has been a crucial component of Apify's scraping for years. We use it to extract data from billions of web pages every month, and we really appreciate the powerful API and extensibility, which allowed us to build our own specialized HTTP client on top of Got. The support has always been stellar too.
|
|
501
|
-
>
|
|
502
|
-
> — <a href="https://github.com/mnmkng">Ondra Urban</a>
|