diff options
author | isaacs <i@izs.me> | 2010-03-23 03:17:03 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-03-23 03:17:03 +0300 |
commit | dcb3f5e8727d329690186f79ef4fb459a47a9e0c (patch) | |
tree | bff5f1e9424174916700649384b1046685ef9e15 /npm.js | |
parent | 49868f7fb90ef3d390817dca3cb7a27ae2d7cce1 (diff) |
Use the config for the root setting.
Diffstat (limited to 'npm.js')
-rwxr-xr-x | npm.js | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 }); |