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
path: root/npm.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2010-03-23 03:17:03 +0300
committerisaacs <i@izs.me>2010-03-23 03:17:03 +0300
commitdcb3f5e8727d329690186f79ef4fb459a47a9e0c (patch)
treebff5f1e9424174916700649384b1046685ef9e15 /npm.js
parent49868f7fb90ef3d390817dca3cb7a27ae2d7cce1 (diff)
Use the config for the root setting.
Diffstat (limited to 'npm.js')
-rwxr-xr-xnpm.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/npm.js b/npm.js
index 30ea0e780..36877ea85 100755
--- a/npm.js
+++ b/npm.js
@@ -38,13 +38,16 @@ npm.get = function (name) { return get(registry, name) };
var path = require("path");
-npm.root = path.join(process.env.HOME, ".node_libraries");
+Object.defineProperty(npm, "root",
+ { get: function () { return npm.config.root }
+ , set: function (newRoot) { npm.config.set("root", newRoot) }
+ });
Object.defineProperty(npm, "dir",
{ get: function () { return path.join(npm.root, ".npm") }
, enumerable:true
});
Object.defineProperty(npm, "tmp",
- { get: function () { return path.join(npm.dir, "tmp") }
+ { get: function () { return path.join(npm.root, ".npm", "tmp") }
, enumerable:true
});