diff options
Diffstat (limited to 'lib/npm.js')
-rw-r--r-- | lib/npm.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/npm.js b/lib/npm.js index dffe35625..ea9759265 100644 --- a/lib/npm.js +++ b/lib/npm.js @@ -477,9 +477,14 @@ Object.defineProperty(npm, "cache", }) var tmpFolder +var crypto = require("crypto") +var rand = crypto.randomBytes(6) + .toString("base64") + .replace(/\//g, '_') + .replace(/\+/, '-') Object.defineProperty(npm, "tmp", { get : function () { - if (!tmpFolder) tmpFolder = "npm-" + process.pid + if (!tmpFolder) tmpFolder = "npm-" + process.pid + "-" + rand return path.resolve(npm.config.get("tmp"), tmpFolder) } , enumerable : true |