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-04-25 03:42:22 +0400
committerisaacs <i@izs.me>2010-04-25 03:42:22 +0400
commitf45ac528f395357902cec08254279355674013fc (patch)
treeb2bb7b162a6e1d7e74693988c51aa96131124ce9 /npm.js
parent31a7579d1f3b5e43e66c644c529e091dfff06f74 (diff)
Refactor the commands onto npm.commands
Diffstat (limited to 'npm.js')
-rwxr-xr-xnpm.js35
1 files changed, 19 insertions, 16 deletions
diff --git a/npm.js b/npm.js
index 7aeecd11b..c9111c3d9 100755
--- a/npm.js
+++ b/npm.js
@@ -5,22 +5,25 @@ var npm = exports,
ini = require("./lib/utils/ini"),
log = require("./lib/utils/log");
-[ "install"
-, "activate"
-, "deactivate"
-, "uninstall"
-, "ls"
-, "build"
-, "link"
-, "publish"
-, "tag"
-, "adduser"
-, "config"
-].forEach(function (c) {
- npm[c] = require("./lib/"+c);
-});
-npm.list = npm.ls;
-npm.rm = npm.uninstall;
+npm.commands = {}
+
+; [ "install"
+ , "activate"
+ , "deactivate"
+ , "uninstall"
+ , "ls"
+ , "build"
+ , "link"
+ , "publish"
+ , "tag"
+ , "adduser"
+ , "config"
+ ].forEach(function (c) {
+ npm.commands[c] = require("./lib/"+c);
+ })
+
+npm.commands.list = npm.commands.ls;
+npm.commands.rm = npm.commands.uninstall;
// Local store for package data, so it won't have to be fetched/read more than
// once in a single pass. TODO: cache this to disk somewhere when we're using