Socket
Socket
Sign inDemoInstall

got-cjs

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

got-cjs - npm Package Compare versions

Comparing version 12.0.0 to 12.0.1

4

dist/source/as-promise/index.js

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const node_events_1 = require("node:events");
const events_1 = require("events");
const is_1 = __importDefault(require("@sindresorhus/is"));

@@ -26,3 +26,3 @@ const p_cancelable_1 = __importDefault(require("p-cancelable"));

let normalizedOptions;
const emitter = new node_events_1.EventEmitter();
const emitter = new events_1.EventEmitter();
const promise = new p_cancelable_1.default((resolve, reject, onCancel) => {

@@ -29,0 +29,0 @@ onCancel(() => {

/// <reference types="node" />
import type { Buffer } from 'node:buffer';
import type { Buffer } from 'buffer';
import PCancelable from 'p-cancelable';

@@ -4,0 +4,0 @@ import { RequestError } from '../core/errors.js';

/// <reference types="node" />
import { Duplex } from 'node:stream';
import { URL } from 'node:url';
import { ServerResponse } from 'node:http';
import type { ClientRequest } from 'node:http';
import type { Socket } from 'node:net';
import { Duplex } from 'stream';
import { URL } from 'url';
import { ServerResponse } from 'http';
import type { ClientRequest } from 'http';
import type { Socket } from 'net';
import CacheableRequest from 'cacheable-request';

@@ -8,0 +8,0 @@ import type { Timings } from '@szmarczak/http-timer';

@@ -25,7 +25,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const node_process_1 = __importDefault(require("node:process"));
const node_buffer_1 = require("node:buffer");
const node_stream_1 = require("node:stream");
const node_url_1 = require("node:url");
const node_http_1 = __importStar(require("node:http"));
const process_1 = __importDefault(require("process"));
const buffer_1 = require("buffer");
const stream_1 = require("stream");
const url_1 = require("url");
const http_1 = __importStar(require("http"));
const http_timer_1 = __importDefault(require("@szmarczak/http-timer"));

@@ -48,3 +48,3 @@ const cacheable_request_1 = __importDefault(require("cacheable-request"));

const errors_js_1 = require("./errors.js");
const supportsBrotli = is_1.default.string(node_process_1.default.versions.brotli);
const supportsBrotli = is_1.default.string(process_1.default.versions.brotli);
const methodsWithoutBody = new Set(['GET', 'HEAD']);

@@ -61,3 +61,3 @@ const cacheableStore = new weakable_map_js_1.default();

const noop = () => { };
class Request extends node_stream_1.Duplex {
class Request extends stream_1.Duplex {
constructor(url, options, defaults) {

@@ -420,3 +420,3 @@ super({

request.retryCount = this.retryCount + 1;
node_process_1.default.nextTick(() => {
process_1.default.nextTick(() => {
void request.flush();

@@ -514,3 +514,3 @@ });

pipe(destination, options) {
if (destination instanceof node_http_1.ServerResponse) {
if (destination instanceof http_1.ServerResponse) {
this._pipedServerResponses.add(destination);

@@ -521,3 +521,3 @@ }

unpipe(destination) {
if (destination instanceof node_http_1.ServerResponse) {
if (destination instanceof http_1.ServerResponse) {
this._pipedServerResponses.delete(destination);

@@ -575,3 +575,3 @@ }

options.form = undefined;
options.body = (new node_url_1.URLSearchParams(form)).toString();
options.body = (new url_1.URLSearchParams(form)).toString();
}

@@ -625,3 +625,3 @@ else {

const typedResponse = response;
typedResponse.statusMessage = typedResponse.statusMessage ? typedResponse.statusMessage : node_http_1.default.STATUS_CODES[statusCode];
typedResponse.statusMessage = typedResponse.statusMessage ? typedResponse.statusMessage : http_1.default.STATUS_CODES[statusCode];
typedResponse.url = options.url.toString();

@@ -705,4 +705,4 @@ typedResponse.requestUrl = this.requestUrl;

// We need this in order to support UTF-8
const redirectBuffer = node_buffer_1.Buffer.from(response.headers.location, 'binary').toString();
const redirectUrl = new node_url_1.URL(redirectBuffer, url);
const redirectBuffer = buffer_1.Buffer.from(response.headers.location, 'binary').toString();
const redirectUrl = new url_1.URL(redirectBuffer, url);
// Redirecting to a different site, clear sensitive data.

@@ -970,3 +970,3 @@ if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) {

if (username || password) {
const credentials = node_buffer_1.Buffer.from(`${username}:${password}`).toString('base64');
const credentials = buffer_1.Buffer.from(`${username}:${password}`).toString('base64');
headers.authorization = `Basic ${credentials}`;

@@ -1058,3 +1058,3 @@ }

if (!error) {
this._uploadedSize += node_buffer_1.Buffer.byteLength(chunk, encoding);
this._uploadedSize += buffer_1.Buffer.byteLength(chunk, encoding);
const progress = this.uploadProgress;

@@ -1061,0 +1061,0 @@ if (progress.percent < 1) {

/// <reference types="node" />
import { Buffer } from 'node:buffer';
import { URL, URLSearchParams } from 'node:url';
import { checkServerIdentity } from 'node:tls';
import { request as httpsRequest } from 'node:https';
import type { Readable } from 'node:stream';
import type { Socket } from 'node:net';
import type { SecureContextOptions, DetailedPeerCertificate } from 'node:tls';
import type { Agent as HttpAgent, ClientRequest } from 'node:http';
import type { RequestOptions as HttpsRequestOptions, Agent as HttpsAgent } from 'node:https';
import { Buffer } from 'buffer';
import { URL, URLSearchParams } from 'url';
import { checkServerIdentity } from 'tls';
import { request as httpsRequest } from 'https';
import type { Readable } from 'stream';
import type { Socket } from 'net';
import type { SecureContextOptions, DetailedPeerCertificate } from 'tls';
import type { Agent as HttpAgent, ClientRequest } from 'http';
import type { RequestOptions as HttpsRequestOptions, Agent as HttpsAgent } from 'https';
import CacheableLookup from 'cacheable-lookup';

@@ -12,0 +12,0 @@ import http2wrapper, { ClientHttp2Session } from 'http2-wrapper';

@@ -25,8 +25,8 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const node_process_1 = __importDefault(require("node:process"));
const node_util_1 = require("node:util");
const node_url_1 = require("node:url");
const node_tls_1 = require("node:tls");
const node_http_1 = require("node:http");
const node_https_1 = require("node:https");
const process_1 = __importDefault(require("process"));
const util_1 = require("util");
const url_1 = require("url");
const tls_1 = require("tls");
const http_1 = require("http");
const https_1 = require("https");
const is_1 = __importStar(require("@sindresorhus/is"));

@@ -38,3 +38,3 @@ const lowercase_keys_1 = __importDefault(require("lowercase-keys"));

const parse_link_header_js_1 = __importDefault(require("./parse-link-header.js"));
const [major, minor] = node_process_1.default.versions.node.split('.').map(v => Number(v));
const [major, minor] = process_1.default.versions.node.split('.').map(v => Number(v));
function validateSearchParameters(searchParameters) {

@@ -194,3 +194,3 @@ // eslint-disable-next-line guard-for-in

return {
url: new node_url_1.URL(next.reference, response.url),
url: new url_1.URL(next.reference, response.url),
};

@@ -234,3 +234,3 @@ }

},
searchParams: internals.searchParams ? new node_url_1.URLSearchParams(internals.searchParams) : undefined,
searchParams: internals.searchParams ? new url_1.URLSearchParams(internals.searchParams) : undefined,
pagination: { ...internals.pagination },

@@ -718,3 +718,3 @@ };

const urlString = `${this.prefixUrl}${value.toString()}`;
const url = new node_url_1.URL(urlString);
const url = new url_1.URL(urlString);
this._internals.url = url;

@@ -778,4 +778,4 @@ decodeURI(urlString);

if (setCookie.length === 4 && getCookieString.length === 0) {
setCookie = (0, node_util_1.promisify)(setCookie.bind(value));
getCookieString = (0, node_util_1.promisify)(getCookieString.bind(value));
setCookie = (0, util_1.promisify)(setCookie.bind(value));
getCookieString = (0, util_1.promisify)(getCookieString.bind(value));
this._internals.cookieJar = {

@@ -826,3 +826,3 @@ setCookie,

if (this._internals.searchParams === undefined) {
this._internals.searchParams = new node_url_1.URLSearchParams();
this._internals.searchParams = new url_1.URLSearchParams();
}

@@ -844,5 +844,5 @@ return this._internals.searchParams;

if (is_1.default.string(value)) {
updated = new node_url_1.URLSearchParams(value);
updated = new url_1.URLSearchParams(value);
}
else if (value instanceof node_url_1.URLSearchParams) {
else if (value instanceof url_1.URLSearchParams) {
updated = value;

@@ -852,3 +852,3 @@ }

validateSearchParameters(value);
updated = new node_url_1.URLSearchParams();
updated = new url_1.URLSearchParams();
// eslint-disable-next-line guard-for-in

@@ -1541,3 +1541,3 @@ for (const key in value) {

[Symbol.for('nodejs.util.inspect.custom')](_depth, options) {
return (0, node_util_1.inspect)(this._internals, options);
return (0, util_1.inspect)(this._internals, options);
}

@@ -1575,3 +1575,3 @@ createNativeRequestOptions() {

rejectUnauthorized: https.rejectUnauthorized,
checkServerIdentity: (_a = https.checkServerIdentity) !== null && _a !== void 0 ? _a : node_tls_1.checkServerIdentity,
checkServerIdentity: (_a = https.checkServerIdentity) !== null && _a !== void 0 ? _a : tls_1.checkServerIdentity,
ciphers: https.ciphers,

@@ -1623,5 +1623,5 @@ honorCipherOrder: https.honorCipherOrder,

}
return node_https_1.request;
return https_1.request;
}
return node_http_1.request;
return http_1.request;
}

@@ -1628,0 +1628,0 @@ freeze() {

/// <reference types="node" />
import type { Buffer } from 'node:buffer';
import type { URL } from 'node:url';
import type { Buffer } from 'buffer';
import type { URL } from 'url';
import type { IncomingMessageWithTimings, Timings } from '@szmarczak/http-timer';

@@ -5,0 +5,0 @@ import { RequestError } from './errors.js';

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

import { ClientRequest } from 'node:http';
import { ClientRequest } from 'http';
declare const reentry: unique symbol;

@@ -3,0 +3,0 @@ interface TimedOutOptions {

@@ -7,3 +7,3 @@ "use strict";

exports.TimeoutError = void 0;
const node_net_1 = __importDefault(require("node:net"));
const net_1 = __importDefault(require("net"));
const unhandle_js_1 = __importDefault(require("./utils/unhandle.js"));

@@ -96,3 +96,3 @@ const reentry = Symbol('reentry');

if (socket.connecting) {
const hasPath = Boolean(socketPath !== null && socketPath !== void 0 ? socketPath : node_net_1.default.isIP((_a = hostname !== null && hostname !== void 0 ? hostname : host) !== null && _a !== void 0 ? _a : '') !== 0);
const hasPath = Boolean(socketPath !== null && socketPath !== void 0 ? socketPath : net_1.default.isIP((_a = hostname !== null && hostname !== void 0 ? hostname : host) !== null && _a !== void 0 ? _a : '') !== 0);
if (hasLookup && !hasPath && typeof socket.address().address === 'undefined') {

@@ -99,0 +99,0 @@ const cancelTimeout = addTimeout(delays.lookup, timeoutHandler, 'lookup');

/// <reference types="node" />
import { ClientRequestArgs } from 'node:http';
import { ClientRequestArgs } from 'http';
export default function getBodySize(body: unknown, headers: ClientRequestArgs['headers']): Promise<number | undefined>;

@@ -6,4 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const node_buffer_1 = require("node:buffer");
const node_util_1 = require("node:util");
const buffer_1 = require("buffer");
const util_1 = require("util");
const is_1 = __importDefault(require("@sindresorhus/is"));

@@ -19,3 +19,3 @@ const is_form_data_js_1 = __importDefault(require("./is-form-data.js"));

if (is_1.default.string(body)) {
return node_buffer_1.Buffer.byteLength(body);
return buffer_1.Buffer.byteLength(body);
}

@@ -26,3 +26,3 @@ if (is_1.default.buffer(body)) {

if ((0, is_form_data_js_1.default)(body)) {
return (0, node_util_1.promisify)(body.getLength.bind(body))();
return (0, util_1.promisify)(body.getLength.bind(body))();
}

@@ -29,0 +29,0 @@ return undefined;

/// <reference types="node" />
import type { Writable, Readable } from 'node:stream';
import type { ClientRequest } from 'node:http';
import type { Writable, Readable } from 'stream';
import type { ClientRequest } from 'http';
declare function isClientRequest(clientRequest: Writable | Readable): clientRequest is ClientRequest;
export default isClientRequest;
/// <reference types="node" />
import { Readable } from 'node:stream';
import { Readable } from 'stream';
interface FormData extends Readable {

@@ -4,0 +4,0 @@ getBoundary: () => string;

/// <reference types="node" />
import { URL } from 'node:url';
import { URL } from 'url';
export interface URLOptions {

@@ -4,0 +4,0 @@ href?: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/* istanbul ignore file: deprecated */
const node_url_1 = require("node:url");
const url_1 = require("url");
const keys = [

@@ -35,3 +35,3 @@ 'protocol',

}
const url = new node_url_1.URL(origin);
const url = new url_1.URL(origin);
if (options.path) {

@@ -38,0 +38,0 @@ const searchIndex = options.path.indexOf('?');

/// <reference types="node" />
import { EventEmitter } from 'node:events';
import { EventEmitter } from 'events';
export default function proxyEvents(from: EventEmitter, to: EventEmitter, events: Readonly<string[]>): () => void;
/// <reference types="node" />
import { EventEmitter } from 'node:events';
import { EventEmitter } from 'events';
declare type Origin = EventEmitter;

@@ -4,0 +4,0 @@ declare type Event = string | symbol;

/// <reference types="node" />
import { URL, UrlWithStringQuery } from 'node:url';
import { URL, UrlWithStringQuery } from 'url';
export interface LegacyUrlOptions {

@@ -4,0 +4,0 @@ protocol: string;

/// <reference types="node" />
import type { Buffer } from 'node:buffer';
import type { URL } from 'node:url';
import type { Buffer } from 'buffer';
import type { URL } from 'url';
import type { CancelableRequest } from './as-promise/types.js';

@@ -5,0 +5,0 @@ import type { Response } from './core/response.js';

{
"name": "got-cjs",
"version": "12.0.0",
"description": "Human-friendly and powerful HTTP request library for Node.js",
"license": "MIT",
"repository": "sindresorhus/got",
"funding": "https://github.com/sindresorhus/got?sponsor=1",
"type": "commonjs",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava",
"release": "np",
"build": "del-cli dist && tsc",
"prepare": "npm run build"
},
"files": [
"dist/source"
],
"keywords": [
"http",
"https",
"http2",
"get",
"got",
"url",
"uri",
"request",
"simple",
"curl",
"wget",
"fetch",
"net",
"network",
"gzip",
"brotli",
"requests",
"human-friendly",
"axios",
"superagent",
"node-fetch",
"ky"
],
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"@szmarczak/http-timer": "4.0.6",
"@types/cacheable-request": "^6.0.2",
"@types/responselike": "^1.0.0",
"cacheable-lookup": "^6.0.4",
"cacheable-request": "^7.0.2",
"decompress-response": "^6.0.0",
"form-data-encoder": "1.7.1",
"get-stream": "^6.0.1",
"http2-wrapper": "^2.1.9",
"lowercase-keys": "2.0.0",
"p-cancelable": "2.1.1",
"responselike": "^2.0.0"
},
"devDependencies": {
"@hapi/bourne": "^2.0.0",
"@sindresorhus/tsconfig": "^2.0.0",
"@sinonjs/fake-timers": "^8.1.0",
"@types/benchmark": "^2.1.1",
"@types/express": "^4.17.13",
"@types/node": "^16.11.12",
"@types/pem": "^1.9.6",
"@types/pify": "^5.0.1",
"@types/readable-stream": "^2.3.12",
"@types/request": "^2.48.7",
"@types/sinon": "^10.0.6",
"@types/sinonjs__fake-timers": "^8.1.1",
"@types/tough-cookie": "^4.0.1",
"ava": "^3.15.0",
"axios": "^0.24.0",
"benchmark": "^2.1.4",
"bluebird": "^3.7.2",
"body-parser": "^1.19.0",
"create-cert": "^1.0.6",
"create-test-server": "^3.0.1",
"del-cli": "^4.0.1",
"delay": "^5.0.0",
"express": "^4.17.1",
"form-data": "^4.0.0",
"formdata-node": "^4.3.1",
"nock": "^13.2.1",
"node-fetch": "^3.1.0",
"np": "^7.6.0",
"nyc": "^15.1.0",
"p-event": "^5.0.1",
"pem": "^1.14.4",
"pify": "^5.0.0",
"readable-stream": "^3.6.0",
"request": "^2.88.2",
"sinon": "^12.0.1",
"slow-stream": "0.0.4",
"tempy": "^2.0.0",
"then-busboy": "^5.1.1",
"to-readable-stream": "^3.0.0",
"tough-cookie": "^4.0.0",
"ts-node": "^10.4.0",
"typescript": "4.5.3",
"xo": "^0.47.0"
},
"types": "dist/source",
"sideEffects": false,
"ava": {
"files": [
"test/*"
],
"timeout": "1m",
"nonSemVerExperiments": {
"nextGenConfig": true,
"configurableModuleFormat": true
},
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader=ts-node/esm"
]
},
"nyc": {
"reporter": [
"text",
"html",
"lcov"
],
"extension": [
".ts"
],
"exclude": [
"**/test/**"
]
},
"xo": {
"ignores": [
"documentation/examples/*"
],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"node/no-deprecated-api": "off",
"node/prefer-global/url": "off",
"node/prefer-global/url-search-params": "off",
"@typescript-eslint/no-implicit-any-catch": "off",
"unicorn/prefer-node-protocol": "off",
"ava/assertion-arguments": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/await-thenable": "off",
"no-lone-blocks": "off",
"unicorn/no-await-expression-member": "off"
}
},
"runkitExampleFilename": "./documentation/examples/runkit-example.js",
"respository": "apify/got-cjs",
"main": "./dist/source/index.js"
}
"name": "got-cjs",
"version": "12.0.1",
"description": "Human-friendly and powerful HTTP request library for Node.js",
"license": "MIT",
"repository": "sindresorhus/got",
"funding": "https://github.com/sindresorhus/got?sponsor=1",
"type": "commonjs",
"engines": {
"node": ">=12"
},
"scripts": {
"test": "xo && ava",
"release": "np",
"build": "del-cli dist && tsc",
"prepare": "npm run build"
},
"files": [
"dist/source"
],
"keywords": [
"http",
"https",
"http2",
"get",
"got",
"url",
"uri",
"request",
"simple",
"curl",
"wget",
"fetch",
"net",
"network",
"gzip",
"brotli",
"requests",
"human-friendly",
"axios",
"superagent",
"node-fetch",
"ky"
],
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"@szmarczak/http-timer": "4.0.6",
"@types/cacheable-request": "^6.0.2",
"@types/responselike": "^1.0.0",
"cacheable-lookup": "^6.0.4",
"cacheable-request": "^7.0.2",
"decompress-response": "^6.0.0",
"form-data-encoder": "1.7.1",
"get-stream": "^6.0.1",
"http2-wrapper": "^2.1.9",
"lowercase-keys": "2.0.0",
"p-cancelable": "2.1.1",
"responselike": "^2.0.0"
},
"devDependencies": {
"@hapi/bourne": "^2.0.0",
"@sindresorhus/tsconfig": "^2.0.0",
"@sinonjs/fake-timers": "^8.1.0",
"@types/benchmark": "^2.1.1",
"@types/express": "^4.17.13",
"@types/node": "^16.11.12",
"@types/pem": "^1.9.6",
"@types/pify": "^5.0.1",
"@types/readable-stream": "^2.3.12",
"@types/request": "^2.48.7",
"@types/sinon": "^10.0.6",
"@types/sinonjs__fake-timers": "^8.1.1",
"@types/tough-cookie": "^4.0.1",
"ava": "^3.15.0",
"axios": "^0.24.0",
"benchmark": "^2.1.4",
"bluebird": "^3.7.2",
"body-parser": "^1.19.0",
"create-cert": "^1.0.6",
"create-test-server": "^3.0.1",
"del-cli": "^4.0.1",
"delay": "^5.0.0",
"express": "^4.17.1",
"form-data": "^4.0.0",
"formdata-node": "^4.3.1",
"nock": "^13.2.1",
"node-fetch": "^3.1.0",
"np": "^7.6.0",
"nyc": "^15.1.0",
"p-event": "^5.0.1",
"pem": "^1.14.4",
"pify": "^5.0.0",
"readable-stream": "^3.6.0",
"request": "^2.88.2",
"sinon": "^12.0.1",
"slow-stream": "0.0.4",
"tempy": "^2.0.0",
"then-busboy": "^5.1.1",
"to-readable-stream": "^3.0.0",
"tough-cookie": "^4.0.0",
"ts-node": "^10.4.0",
"typescript": "4.5.3",
"xo": "^0.47.0"
},
"types": "dist/source",
"sideEffects": false,
"ava": {
"files": [
"test/*"
],
"timeout": "1m",
"nonSemVerExperiments": {
"nextGenConfig": true,
"configurableModuleFormat": true
},
"extensions": {
"ts": "module"
},
"nodeArguments": [
"--loader=ts-node/esm"
]
},
"nyc": {
"reporter": [
"text",
"html",
"lcov"
],
"extension": [
".ts"
],
"exclude": [
"**/test/**"
]
},
"xo": {
"ignores": [
"documentation/examples/*"
],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"node/no-deprecated-api": "off",
"node/prefer-global/url": "off",
"node/prefer-global/url-search-params": "off",
"@typescript-eslint/no-implicit-any-catch": "off",
"unicorn/prefer-node-protocol": "off",
"ava/assertion-arguments": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/await-thenable": "off",
"no-lone-blocks": "off",
"unicorn/no-await-expression-member": "off"
}
},
"runkitExampleFilename": "./documentation/examples/runkit-example.js",
"respository": "apify/got-cjs",
"main": "./dist/source/index.js"
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc