diff options
author | isaacs <i@izs.me> | 2010-04-25 03:42:22 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-04-25 03:42:22 +0400 |
commit | f45ac528f395357902cec08254279355674013fc (patch) | |
tree | b2bb7b162a6e1d7e74693988c51aa96131124ce9 /npm.js | |
parent | 31a7579d1f3b5e43e66c644c529e091dfff06f74 (diff) |
Refactor the commands onto npm.commands
Diffstat (limited to 'npm.js')
-rwxr-xr-x | npm.js | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -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 |