From 3987807ed9ac82717548d6df53bbb755ac09cfbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kat=20March=C3=A1n?= Date: Thu, 9 Mar 2017 10:52:41 -0800 Subject: [PATCH] feat(request): accept maxSockets opt --- lib/registry/request.js | 3 ++- lib/util/opt-check.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/registry/request.js b/lib/registry/request.js index 9553c76..a9395d1 100644 --- a/lib/registry/request.js +++ b/lib/registry/request.js @@ -215,7 +215,8 @@ function client (opts) { var RegistryClient = require('npm-registry-client') CLIENT_OPTS = { log: opts.log, - retry: opts.retry + retry: opts.retry, + maxSockets: opts.maxSockets } CLIENT = new RegistryClient(CLIENT_OPTS) } diff --git a/lib/util/opt-check.js b/lib/util/opt-check.js index 06e4800..c024565 100644 --- a/lib/util/opt-check.js +++ b/lib/util/opt-check.js @@ -16,6 +16,7 @@ function PacoteOptions (opts) { this.hashAlgorithm = opts.hashAlgorithm || 'sha1' this.log = opts.log || silentlog this.maxAge = typeof opts.maxAge === 'undefined' ? 1000 : opts.maxAge + this.maxSockets = opts.maxSockets || 10 this.memoize = !!opts.memoize this.offline = opts.offline this.pkg = opts.pkg