From 7e53355b4cd9684656ebc47b73f45cbd53ab0ccf Mon Sep 17 00:00:00 2001 From: zkochan Date: Thu, 20 Jul 2017 01:50:50 +0300 Subject: [PATCH] docs: add note about why the whole manifest is downloaded --- src/resolve/npm/loadPackageMeta.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/resolve/npm/loadPackageMeta.ts b/src/resolve/npm/loadPackageMeta.ts index deeb5716a6..11e3cdc199 100644 --- a/src/resolve/npm/loadPackageMeta.ts +++ b/src/resolve/npm/loadPackageMeta.ts @@ -111,7 +111,12 @@ function saveMeta (pkgMirror: string, meta: PackageMeta): Promise { * * @example * toUri({ name: 'rimraf', rawSpec: '2' }) - * // => 'https://registry.npmjs.org/rimraf/2' + * // => 'https://registry.npmjs.org/rimraf' + * + * Although it is possible to download the needed package.json with one request + * by passing the spec like this: 'https://registry.npmjs.org/rimraf/2' + * This increases the number of HTTP requests during installation and slows down + * pnpm up to twice! */ function toUri (spec: PackageSpec, registry: string) { let name: string