fetch-from-npm-registry
Advanced tools
Comparing version 2.0.7 to 3.0.0
@@ -0,1 +1,2 @@ | ||
import { Response } from '@pnpm/fetch'; | ||
export declare type Auth = ({ | ||
@@ -54,2 +55,2 @@ token: string; | ||
}) | undefined; | ||
} | undefined) => Promise<any>; | ||
} | undefined) => Promise<Response>; |
@@ -12,10 +12,17 @@ "use strict"; | ||
return async (url, opts) => { | ||
const headers = Object.assign({ 'user-agent': USER_AGENT }, getHeaders({ | ||
auth: opts && opts.auth, | ||
fullMetadata: defaultOpts.fullMetadata, | ||
userAgent: defaultOpts.userAgent, | ||
})); | ||
var _a; | ||
const headers = { | ||
'user-agent': USER_AGENT, | ||
...getHeaders({ | ||
auth: (_a = opts) === null || _a === void 0 ? void 0 : _a.auth, | ||
fullMetadata: defaultOpts.fullMetadata, | ||
userAgent: defaultOpts.userAgent, | ||
}), | ||
}; | ||
let redirects = 0; | ||
while (true) { | ||
const agent = npm_registry_agent_1.default(url, Object.assign({}, defaultOpts, opts)); // tslint:disable-line | ||
const agent = npm_registry_agent_1.default(url, { | ||
...defaultOpts, | ||
...opts, | ||
}); // tslint:disable-line | ||
headers['connection'] = agent ? 'keep-alive' : 'close'; | ||
@@ -22,0 +29,0 @@ // We should pass a URL object to node-fetch till this is not resolved: |
{ | ||
"name": "fetch-from-npm-registry", | ||
"version": "2.0.7", | ||
"description": "A fetch lib specifically for using with the npm registry", | ||
"main": "lib/index.js", | ||
"typings": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"engines": { | ||
"node": ">=8.15" | ||
}, | ||
"scripts": { | ||
"lint": "tslint -c tslint.json src/**/*.ts test/**/*.ts", | ||
"tsc": "rimraf lib && tsc", | ||
"test": "pnpm run tsc && pnpm run lint && ts-node test --type-check", | ||
"prepublishOnly": "pnpm run tsc" | ||
}, | ||
"repository": "https://github.com/pnpm/pnpm/blob/master/packages/fetch-from-npm-registry", | ||
"keywords": [ | ||
"fetch", | ||
"npm" | ||
], | ||
"author": "Zoltan Kochan <z@kochan.io> (https://www.kochan.io/)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/pnpm/pnpm/issues" | ||
}, | ||
"homepage": "https://github.com/pnpm/pnpm/blob/master/packages/fetch-from-npm-registry#readme", | ||
"dependencies": { | ||
"@pnpm/fetch": "1.0.1", | ||
"@pnpm/npm-registry-agent": "1.0.3" | ||
}, | ||
"devDependencies": { | ||
"@types/nock": "10.0.3", | ||
"fetch-from-npm-registry": "link:", | ||
"nock": "10.0.6", | ||
"rimraf": "^2.6.2", | ||
"tape": "4.11.0" | ||
} | ||
"name": "fetch-from-npm-registry", | ||
"version": "3.0.0", | ||
"description": "A fetch lib specifically for using with the npm registry", | ||
"main": "lib/index.js", | ||
"typings": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"engines": { | ||
"node": ">=10" | ||
}, | ||
"scripts": { | ||
"lint": "tslint -c tslint.json src/**/*.ts test/**/*.ts", | ||
"tsc": "rimraf lib && tsc", | ||
"test": "pnpm run tsc && pnpm run lint && ts-node test --type-check", | ||
"prepublishOnly": "pnpm run tsc" | ||
}, | ||
"repository": "https://github.com/pnpm/pnpm/blob/master/packages/fetch-from-npm-registry", | ||
"keywords": [ | ||
"fetch", | ||
"npm" | ||
], | ||
"author": "Zoltan Kochan <z@kochan.io> (https://www.kochan.io/)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/pnpm/pnpm/issues" | ||
}, | ||
"homepage": "https://github.com/pnpm/pnpm/blob/master/packages/fetch-from-npm-registry#readme", | ||
"dependencies": { | ||
"@pnpm/fetch": "1.0.1", | ||
"@pnpm/npm-registry-agent": "2.0.0" | ||
}, | ||
"devDependencies": { | ||
"fetch-from-npm-registry": "link:", | ||
"nock": "11.7.0", | ||
"rimraf": "3.0.0", | ||
"tape": "4.11.0" | ||
} | ||
} |
7952
4
133
+ Added@pnpm/npm-registry-agent@2.0.0(transitive)
+ Addedhttps-proxy-agent@3.0.1(transitive)
- Removed@pnpm/npm-registry-agent@1.0.3(transitive)
- Removedhttps-proxy-agent@2.2.1(transitive)