Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/config/pacote.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/config/pacote.js b/lib/config/pacote.js
index 705544fe3..9f2d35678 100644
--- a/lib/config/pacote.js
+++ b/lib/config/pacote.js
@@ -2,6 +2,7 @@
const Buffer = require('safe-buffer').Buffer
+const crypto = require("crypto")
const npm = require('../npm')
const log = require('npmlog')
let pack
@@ -9,6 +10,9 @@ const path = require('path')
let effectiveOwner
+const npmSession = crypto.randomBytes(8).toString('hex')
+log.verbose('npm-session', npmSession)
+
module.exports = pacoteOpts
function pacoteOpts (moreOpts) {
if (!pack) {
@@ -24,6 +28,7 @@ function pacoteOpts (moreOpts) {
log: log,
maxAge: npm.config.get('cache-min'),
maxSockets: npm.config.get('maxsockets'),
+ npmSession: npmSession,
offline: npm.config.get('offline'),
preferOffline: npm.config.get('prefer-offline') || npm.config.get('cache-min') > 9999,
preferOnline: npm.config.get('prefer-online') || npm.config.get('cache-max') <= 0,