diff options
author | isaacs <i@izs.me> | 2011-08-07 00:51:59 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-08-07 00:51:59 +0400 |
commit | 645cef3e775a4fee225c7921c96367c11cf1139c (patch) | |
tree | d5ae1b009a3da07b55606af84109d90292b8208f /lib | |
parent | 9c0b24898b782e2bf43073bb1d836bbe67b339b3 (diff) |
Put .js on filenames
Diffstat (limited to 'lib')
76 files changed, 286 insertions, 284 deletions
diff --git a/lib/adduser.js b/lib/adduser.js index dd68dda65..97dc2e2ec 100644 --- a/lib/adduser.js +++ b/lib/adduser.js @@ -1,12 +1,12 @@ module.exports = adduser -var registry = require('./utils/npm-registry-client') - , ini = require("./utils/ini") - , log = require("./utils/log") - , npm = require("../npm") - , prompt = require("./utils/prompt") - , promiseChain = require("./utils/promise-chain") +var registry = require("./utils/npm-registry-client/index.js") + , ini = require("./utils/ini.js") + , log = require("./utils/log.js") + , npm = require("../npm.js") + , prompt = require("./utils/prompt.js") + , promiseChain = require("./utils/promise-chain.js") , crypto try { diff --git a/lib/bin.js b/lib/bin.js index ff25c89dd..6acaf2829 100644 --- a/lib/bin.js +++ b/lib/bin.js @@ -1,7 +1,7 @@ module.exports = bin -var npm = require("../npm") - , output = require("./utils/output") +var npm = require("../npm.js") + , output = require("./utils/output.js") bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)" diff --git a/lib/build.js b/lib/build.js index c03016620..f383b3de3 100644 --- a/lib/build.js +++ b/lib/build.js @@ -8,17 +8,17 @@ // This runs AFTER install or link are completed. -var npm = require("../npm") - , log = require("./utils/log") +var npm = require("../npm.js") + , log = require("./utils/log.js") , chain = require("slide").chain , fs = require("graceful-fs") , path = require("path") - , lifecycle = require("./utils/lifecycle") - , readJson = require("./utils/read-json") - , link = require("./utils/link") + , lifecycle = require("./utils/lifecycle.js") + , readJson = require("./utils/read-json.js") + , link = require("./utils/link.js") , linkIfExists = link.ifExists , asyncMap = require("slide").asyncMap - , output = require("./utils/output") + , output = require("./utils/output.js") module.exports = build build.usage = "npm build <folder>\n(this is plumbing)" diff --git a/lib/cache.js b/lib/cache.js index 9c5da19d7..b25d0b4f7 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -31,25 +31,25 @@ exports.read = read exports.clean = clean exports.unpack = unpack -var mkdir = require("./utils/mkdir-p") - , exec = require("./utils/exec") - , fetch = require("./utils/fetch") - , npm = require("../npm") +var mkdir = require("./utils/mkdir-p.js") + , exec = require("./utils/exec.js") + , fetch = require("./utils/fetch.js") + , npm = require("../npm.js") , fs = require("graceful-fs") - , rm = require("./utils/rm-rf") - , readJson = require("./utils/read-json") - , registry = require("./utils/npm-registry-client") - , log = require("./utils/log") + , rm = require("./utils/rm-rf.js") + , readJson = require("./utils/read-json.js") + , registry = require("./utils/npm-registry-client/index.js") + , log = require("./utils/log.js") , path = require("path") , output - , sha = require("./utils/sha") - , find = require("./utils/find") + , sha = require("./utils/sha.js") + , find = require("./utils/find.js") , asyncMap = require("slide").asyncMap , semver = require("semver") - , tar = require("./utils/tar") + , tar = require("./utils/tar.js") , FMODE = tar.FMODE , DMODE = tar.DMODE - , fileCompletion = require("./utils/completion/file-completion") + , fileCompletion = require("./utils/completion/file-completion.js") , url = require("url") cache.usage = "npm cache add <tarball file>" @@ -125,7 +125,7 @@ function read (name, ver, forceBypass, cb) { // npm cache ls [<path>] function ls (args, cb) { - output = output || require("./utils/output") + output = output || require("./utils/output.js") args = args.join("/").split("@").join("/") if (args.substr(-1) === "/") args = args.substr(0, args.length - 1) ls_(args, npm.config.get("depth"), function(er, files) { diff --git a/lib/completion.js b/lib/completion.js index b02422765..82d0bdebf 100644 --- a/lib/completion.js +++ b/lib/completion.js @@ -5,8 +5,8 @@ completion.usage = "npm completion >> ~/.bashrc\n" + "npm completion >> ~/.zshrc\n" + "source <(npm completion)" -var output = require("./utils/output") - , configDefs = require("./utils/config-defs") +var output = require("./utils/output.js") + , configDefs = require("./utils/config-defs.js") , configTypes = configDefs.types , shorthands = configDefs.shorthands , nopt = require("nopt") @@ -16,7 +16,7 @@ var output = require("./utils/output") , shorthandNames = Object.keys(shorthands) , allConfs = configNames.concat(shorthandNames) , stdio = process.binding("stdio") - , npm = require("../npm") + , npm = require("../npm.js") completion.completion = function (opts, cb) { if (opts.w > 3) return cb() diff --git a/lib/config.js b/lib/config.js index c3fed9922..12281c024 100644 --- a/lib/config.js +++ b/lib/config.js @@ -7,14 +7,14 @@ config.usage = "npm config set <key> <value>" + "\nnpm config list" + "\nnpm config edit" -var ini = require("./utils/ini") - , log = require("./utils/log") - , npm = require("../npm") - , exec = require("./utils/exec") +var ini = require("./utils/ini.js") + , log = require("./utils/log.js") + , npm = require("../npm.js") + , exec = require("./utils/exec.js") , fs = require("graceful-fs") , dc - , output = require("./utils/output") - , types = require("./utils/config-defs").types + , output = require("./utils/output.js") + , types = require("./utils/config-defs.js").types config.completion = function (opts, cb) { var argv = opts.conf.argv.remain @@ -65,7 +65,7 @@ function edit (cb) { if (er) return cb(er) fs.readFile(f, "utf8", function (er, data) { if (er) data = "" - dc = dc || require("./utils/config-defs").defaults + dc = dc || require("./utils/config-defs.js").defaults data = [ ";;;;" , "; npm "+(ini.get("global") ? "globalconfig" : "userconfig")+" file" , "; this is a simple ini-formatted file" diff --git a/lib/deprecate.js b/lib/deprecate.js index fb15bb70e..28c7e831f 100644 --- a/lib/deprecate.js +++ b/lib/deprecate.js @@ -18,10 +18,10 @@ deprecate.completion = function (opts, cb) { }) } -var registry = require("./utils/npm-registry-client") +var registry = require("./utils/npm-registry-client/index.js") , semver = require("semver") - , log = require("./utils/log") - , npm = require("../npm") + , log = require("./utils/log.js") + , npm = require("../npm.js") function deprecate (args, cb) { var pkg = args[0] diff --git a/lib/docs.js b/lib/docs.js index 29bf8849c..219f91b9c 100644 --- a/lib/docs.js +++ b/lib/docs.js @@ -10,10 +10,11 @@ docs.completion = function (opts, cb) { }) } -var exec = require("./utils/exec") - , registry = require("./utils/npm-registry-client") - , npm = require("../npm") - , log = require("./utils/log") +var exec = require("./utils/exec.js") + , registry = require("./utils/npm-registry-client/index.js") + , npm = require("../npm.js") + , log = require("./utils/log.js") + function docs (args, cb) { if (!args.length) return cb(docs.usage) var n = args[0].split("@").shift() diff --git a/lib/edit.js b/lib/edit.js index 33d2f10f5..f8f3b9a89 100644 --- a/lib/edit.js +++ b/lib/edit.js @@ -4,13 +4,13 @@ module.exports = edit edit.usage = "npm edit <pkg>" -edit.completion = require("./utils/completion/installed-shallow") +edit.completion = require("./utils/completion/installed-shallow.js") -var npm = require("../npm") - , exec = require("./utils/exec") +var npm = require("../npm.js") + , exec = require("./utils/exec.js") , path = require("path") , fs = require("graceful-fs") - , log = require("./utils/log") + , log = require("./utils/log.js") function edit (args, cb) { var p = args[0] diff --git a/lib/explore.js b/lib/explore.js index d5f262741..aa6178186 100644 --- a/lib/explore.js +++ b/lib/explore.js @@ -3,10 +3,10 @@ module.exports = explore explore.usage = "npm explore <pkg> [ -- <cmd>]" -explore.completion = require("./utils/completion/installed-shallow") +explore.completion = require("./utils/completion/installed-shallow.js") -var npm = require("../npm") - , exec = require("./utils/exec") +var npm = require("../npm.js") + , exec = require("./utils/exec.js") , path = require("path") , fs = require("graceful-fs") diff --git a/lib/faq.js b/lib/faq.js index b4e4ea917..32df1e252 100644 --- a/lib/faq.js +++ b/lib/faq.js @@ -3,6 +3,6 @@ module.exports = faq faq.usage = "npm faq" -var npm = require("../npm") +var npm = require("../npm.js") function faq (args, cb) { npm.commands.help(["faq"], cb) } diff --git a/lib/get.js b/lib/get.js index f8e23b49f..8d445ff27 100644 --- a/lib/get.js +++ b/lib/get.js @@ -3,7 +3,7 @@ module.exports = get get.usage = "npm get <key> <value> (See `npm config`)" -var npm = require("../npm") +var npm = require("../npm.js") get.completion = npm.commands.config.completion diff --git a/lib/help-search.js b/lib/help-search.js index 03a206e54..e36dd7bab 100644 --- a/lib/help-search.js +++ b/lib/help-search.js @@ -2,12 +2,12 @@ module.exports = helpSearch var fs = require("graceful-fs") - , output = require("./utils/output") + , output = require("./utils/output.js") , path = require("path") , asyncMap = require("slide").asyncMap , docsPath = path.join(__dirname, "..", "doc") - , log = require("./utils/log") - , npm = require("../npm") + , log = require("./utils/log.js") + , npm = require("../npm.js") helpSearch.usage = "npm help-search <text>" diff --git a/lib/help.js b/lib/help.js index 8a8bae1fa..cc0a3c5a1 100644 --- a/lib/help.js +++ b/lib/help.js @@ -8,9 +8,9 @@ help.completion = function (opts, cb) { var fs = require("graceful-fs") , path = require("path") - , exec = require("./utils/exec") - , npm = require("../npm") - , output = require("./utils/output") + , exec = require("./utils/exec.js") + , npm = require("../npm.js") + , output = require("./utils/output.js") function help (args, cb) { if (args.length > 1 && args[0]) return npm.commands["help-search"](args, cb) diff --git a/lib/init.js b/lib/init.js index a3b5af0be..26b9f8415 100644 --- a/lib/init.js +++ b/lib/init.js @@ -3,16 +3,16 @@ module.exports = init -var prompt = require("./utils/prompt") +var prompt = require("./utils/prompt.js") , path = require("path") - , readJson = require("./utils/read-json") + , readJson = require("./utils/read-json.js") , fs = require("graceful-fs") - , promiseChain = require("./utils/promise-chain") - , exec = require("./utils/exec") + , promiseChain = require("./utils/promise-chain.js") + , exec = require("./utils/exec.js") , semver = require("semver") - , log = require("./utils/log") - , npm = require("../npm") - , output = require("./utils/output") + , log = require("./utils/log.js") + , npm = require("../npm.js") + , output = require("./utils/output.js") init.usage = "npm init [folder]" diff --git a/lib/install.js b/lib/install.js index 11a448f40..7c2332a12 100644 --- a/lib/install.js +++ b/lib/install.js @@ -106,7 +106,7 @@ install.completion = function (opts, cb) { // if it has a slash, then it's gotta be a folder // if it starts with https?://, then just give up, because it's a url // for now, not yet implemented. - var registry = require("./utils/npm-registry-client") + var registry = require("./utils/npm-registry-client/index.js") registry.get("/-/short", function (er, pkgs) { if (er) return cb() if (!opts.partialWord) return cb(null, pkgs) @@ -131,27 +131,27 @@ install.completion = function (opts, cb) { }) } -var npm = require("../npm") +var npm = require("../npm.js") , semver = require("semver") - , readJson = require("./utils/read-json") - , log = require("./utils/log") + , readJson = require("./utils/read-json.js") + , log = require("./utils/log.js") , path = require("path") , fs = require("graceful-fs") - , cache = require("./cache") + , cache = require("./cache.js") , asyncMap = require("slide").asyncMap , chain = require("slide").chain - , relativize = require("./utils/relativize") + , relativize = require("./utils/relativize.js") , output , url = require("url") - , mkdir = require("./utils/mkdir-p") - , lifecycle = require("./utils/lifecycle") + , mkdir = require("./utils/mkdir-p.js") + , lifecycle = require("./utils/lifecycle.js") function install (args, cb_) { function cb (er, installed) { if (er) return cb_(er) - output = output || require("./utils/output") + output = output || require("./utils/output.js") var tree = treeify(installed) , pretty = prettify(tree, installed) diff --git a/lib/link.js b/lib/link.js index d529c56f2..7074f5a56 100644 --- a/lib/link.js +++ b/lib/link.js @@ -2,17 +2,17 @@ // link with no args: symlink the folder to the global location // link with package arg: symlink the global to the local -var npm = require("../npm") - , symlink = require("./utils/link") +var npm = require("../npm.js") + , symlink = require("./utils/link.js") , fs = require("graceful-fs") - , log = require("./utils/log") + , log = require("./utils/log.js") , asyncMap = require("slide").asyncMap , chain = require("slide").chain , path = require("path") - , relativize = require("./utils/relativize") - , rm = require("./utils/rm-rf") - , output = require("./utils/output") - , build = require("./build") + , relativize = require("./utils/relativize.js") + , rm = require("./utils/rm-rf.js") + , output = require("./utils/output.js") + , build = require("./build.js") module.exports = link @@ -102,7 +102,7 @@ function linkInstall (pkgs, cb) { function linkPkg (folder, cb_) { var gp = npm.config.get("prefix") , me = folder || npm.prefix - , readJson = require("./utils/read-json") + , readJson = require("./utils/read-json.js") readJson( path.resolve(me, "package.json") , { dev: true } , function (er, d) { @@ -7,11 +7,11 @@ module.exports = exports = ls -var npm = require("../npm") - , readInstalled = require("./utils/read-installed") - , output = require("./utils/output") - , log = require("./utils/log") - , relativize = require("./utils/relativize") +var npm = require("../npm.js") + , readInstalled = require("./utils/read-installed.js") + , output = require("./utils/output.js") + , log = require("./utils/log.js") + , relativize = require("./utils/relativize.js") , path = require("path") ls.usage = "npm ls" diff --git a/lib/outdated.js b/lib/outdated.js index 92267b266..659e04a74 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -15,18 +15,18 @@ module.exports = outdated outdated.usage = "npm outdated [<pkg> [<pkg> ...]]" -outdated.completion = require("./utils/completion/installed-deep") +outdated.completion = require("./utils/completion/installed-deep.js") var path = require("path") , fs = require("graceful-fs") - , readJson = require("./utils/read-json") - , cache = require("./cache") + , readJson = require("./utils/read-json.js") + , cache = require("./cache.js") , asyncMap = require("slide").asyncMap - , npm = require("../npm") - , log = require("./utils/log") + , npm = require("../npm.js") + , log = require("./utils/log.js") , semver = require("semver") - , relativize = require("./utils/relativize") + , relativize = require("./utils/relativize.js") function outdated (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false @@ -37,7 +37,7 @@ function outdated (args, silent, cb) { if (er || silent) return cb_(er) var outList = list.map(makePretty) - require("./utils/output").write(outList.join("\n"), cb_) + require("./utils/output.js").write(outList.join("\n"), cb_) }) } diff --git a/lib/owner.js b/lib/owner.js index 509eac95d..5a2d3b92d 100644 --- a/lib/owner.js +++ b/lib/owner.js @@ -64,12 +64,12 @@ owner.completion = function (opts, cb) { } } -var registry = require("./utils/npm-registry-client") +var registry = require("./utils/npm-registry-client/index.js") , get = registry.request.GET , put = registry.request.PUT - , log = require("./utils/log") + , log = require("./utils/log.js") , output - , npm = require("../npm") + , npm = require("../npm.js") function owner (args, cb) { var action = args.shift() @@ -89,7 +89,7 @@ function ls (pkg, cb) { var owners = data.maintainers if (!owners || !owners.length) msg = "admin party!" else msg = owners.map(function (o) { return o.name +" <"+o.email+">" }).join("\n") - output = output || require("./utils/output") + output = output || require("./utils/output.js") output.write(msg, function (er) { cb(er, owners) }) }) } @@ -170,7 +170,7 @@ function mutate (pkg, user, mutation, cb) { function readLocalPkg (cb) { if (npm.config.get("global")) return cb() var path = require("path") - , readJson = require("./utils/read-json") + , readJson = require("./utils/read-json.js") readJson(path.resolve(npm.prefix, "package.json"), function (er, d) { return cb(er, d && d.name) }) diff --git a/lib/pack.js b/lib/pack.js index d84dd828f..985186eef 100644 --- a/lib/pack.js +++ b/lib/pack.js @@ -4,14 +4,14 @@ module.exports = pack -var npm = require("../npm") - , install = require("./install") - , cache = require("./cache") - , output = require("./utils/output") +var npm = require("../npm.js") + , install = require("./install.js") + , cache = require("./cache.js") + , output = require("./utils/output.js") , fs = require("graceful-fs") , chain = require("slide").chain , path = require("path") - , relativize = require("./utils/relativize") + , relativize = require("./utils/relativize.js") , cwd = process.cwd() pack.usage = "npm pack <pkg>" diff --git a/lib/prefix.js b/lib/prefix.js index 5adcd0d92..73476f24c 100644 --- a/lib/prefix.js +++ b/lib/prefix.js @@ -1,7 +1,7 @@ module.exports = prefix -var npm = require("../npm") - , output = require("./utils/output") +var npm = require("../npm.js") + , output = require("./utils/output.js") prefix.usage = "npm prefix\nnpm prefix -g\n(just prints the prefix folder)" diff --git a/lib/prune.js b/lib/prune.js index b830d2e21..3d659e480 100644 --- a/lib/prune.js +++ b/lib/prune.js @@ -4,10 +4,10 @@ module.exports = prune prune.usage = "npm prune" -var readInstalled = require("./utils/read-installed") - , npm = require("../npm") +var readInstalled = require("./utils/read-installed.js") + , npm = require("../npm.js") -prune.completion = require("./utils/completion/installed-deep") +prune.completion = require("./utils/completion/installed-deep.js") function prune (args, cb) { readInstalled(npm.prefix, function (er, data) { diff --git a/lib/publish.js b/lib/publish.js index e1bdbd6e1..e0fe7bce9 100644 --- a/lib/publish.js +++ b/lib/publish.js @@ -1,15 +1,15 @@ module.exports = publish -var npm = require("../npm") - , registry = require("./utils/npm-registry-client") - , log = require("./utils/log") - , tar = require("./utils/tar") - , sha = require("./utils/sha") +var npm = require("../npm.js") + , registry = require("./utils/npm-registry-client/index.js") + , log = require("./utils/log.js") + , tar = require("./utils/tar.js") + , sha = require("./utils/sha.js") , path = require("path") - , readJson = require("./utils/read-json") - , fs = require("fs") - , lifecycle = require("./utils/lifecycle") + , readJson = require("./utils/read-json.js") + , fs = require("graceful-fs") + , lifecycle = require("./utils/lifecycle.js") , chain = require("slide").chain publish.usage = "npm publish <tarball>" diff --git a/lib/rebuild.js b/lib/rebuild.js index 16c54f93a..f5773583f 100644 --- a/lib/rebuild.js +++ b/lib/rebuild.js @@ -1,16 +1,16 @@ module.exports = rebuild -var readInstalled = require("./utils/read-installed") +var readInstalled = require("./utils/read-installed.js") , semver = require("semver") - , log = require("./utils/log") + , log = require("./utils/log.js") , path = require("path") - , npm = require("../npm") - , output = require("./utils/output") + , npm = require("../npm.js") + , output = require("./utils/output.js") rebuild.usage = "npm rebuild [<name>[@<version>] [name[@<version>] ...]]" -rebuild.completion = require("./utils/completion/installed-deep") +rebuild.completion = require("./utils/completion/installed-deep.js") function rebuild (args, cb) { readInstalled(npm.prefix, function (er, data) { diff --git a/lib/restart.js b/lib/restart.js index 673ef05af..69c4b913d 100644 --- a/lib/restart.js +++ b/lib/restart.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle").cmd("restart") +module.exports = require("./utils/lifecycle.js").cmd("restart") diff --git a/lib/root.js b/lib/root.js index c9805466a..364e5ddbe 100644 --- a/lib/root.js +++ b/lib/root.js @@ -1,8 +1,8 @@ module.exports = root -var npm = require("../npm") - , output = require("./utils/output") - , log = require("./utils/log") +var npm = require("../npm.js") + , output = require("./utils/output.js") + , log = require("./utils/log.js") root.usage = "npm root\nnpm root -g\n(just prints the root folder)" diff --git a/lib/run-script.js b/lib/run-script.js index 2cf0537f0..c00747ca1 100644 --- a/lib/run-script.js +++ b/lib/run-script.js @@ -1,11 +1,11 @@ module.exports = runScript -var lifecycle = require("./utils/lifecycle") - , npm = require("../npm") +var lifecycle = require("./utils/lifecycle.js") + , npm = require("../npm.js") , path = require("path") - , readJson = require("./utils/read-json") - , log = require("./utils/log") + , readJson = require("./utils/read-json.js") + , log = require("./utils/log.js") , chain = require("slide").chain , fs = require("graceful-fs") , asyncMap = require("slide").asyncMap @@ -16,7 +16,7 @@ runScript.completion = function (opts, cb) { // see if there's already a package specified. var argv = opts.conf.argv.remain - , installedShallow = require("./utils/completion/installed-shallow") + , installedShallow = require("./utils/completion/installed-shallow.js") if (argv.length >= 4) return cb() diff --git a/lib/search.js b/lib/search.js index ac5bc090f..f16a1c98c 100644 --- a/lib/search.js +++ b/lib/search.js @@ -1,11 +1,11 @@ module.exports = exports = search -var npm = require("../npm") - , registry = require("./utils/npm-registry-client") +var npm = require("../npm.js") + , registry = require("./utils/npm-registry-client/index.js") , semver = require("semver") , output - , log = require("./utils/log") + , log = require("./utils/log.js") search.usage = "npm search [some search terms ...]" @@ -54,7 +54,7 @@ function search (args, silent, staleness, cb_) { // data to the cb. if (er || silent) return cb_(er, data) function cb (er) { return cb_(er, data) } - output = output || require("./utils/output") + output = output || require("./utils/output.js") output.write(prettify(data, args), cb) }) } diff --git a/lib/set.js b/lib/set.js index 0f06d7ec9..1d0fd6d3b 100644 --- a/lib/set.js +++ b/lib/set.js @@ -3,7 +3,7 @@ module.exports = set set.usage = "npm set <key> <value> (See `npm config`)" -var npm = require("../npm") +var npm = require("../npm.js") set.completion = npm.commands.config.completion diff --git a/lib/start.js b/lib/start.js index 1b2c5077b..98823825b 100644 --- a/lib/start.js +++ b/lib/start.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle").cmd("start") +module.exports = require("./utils/lifecycle.js").cmd("start") diff --git a/lib/stop.js b/lib/stop.js index 4f78e3ff0..8ea5ba6aa 100644 --- a/lib/stop.js +++ b/lib/stop.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle").cmd("stop") +module.exports = require("./utils/lifecycle.js").cmd("stop") diff --git a/lib/submodule.js b/lib/submodule.js index 7f8c8bbb6..d90a1de56 100644 --- a/lib/submodule.js +++ b/lib/submodule.js @@ -4,17 +4,17 @@ module.exports = submodule -var npm = require("../npm") - , readJson = require("./utils/read-json") - , exec = require("./utils/exec") - , output = require("./utils/output") - , cache = require("./cache") +var npm = require("../npm.js") + , readJson = require("./utils/read-json.js") + , exec = require("./utils/exec.js") + , output = require("./utils/output.js") + , cache = require("./cache.js") , asyncMap = require("slide").asyncMap , chain = require("slide").chain submodule.usage = "npm submodule <pkg>" -submodule.completion = require("./docs").completion +submodule.completion = require("./docs.js").completion function submodule (args, cb) { if (npm.config.get("global")) { diff --git a/lib/tag.js b/lib/tag.js index b946bf2f8..fef7b06f6 100644 --- a/lib/tag.js +++ b/lib/tag.js @@ -3,9 +3,9 @@ module.exports = tag tag.usage = "npm tag <project>@<version> [<tag>]" -tag.completion = require("./unpublish").completion +tag.completion = require("./unpublish.js").completion -var npm = require("../npm") +var npm = require("../npm.js") function tag (args, cb) { var thing = (args.shift() || "").split("@") @@ -13,5 +13,5 @@ function tag (args, cb) { , version = thing.join("@") , t = args.shift() || npm.config.get("tag") if (!project || !version || !t) return cb("Usage:\n"+tag.usage) - require("./utils/npm-registry-client").tag(project, version, t, cb) + require("./utils/npm-registry-client/index.js").tag(project, version, t, cb) } diff --git a/lib/test.js b/lib/test.js index 79a177a9f..1d2ee30a3 100644 --- a/lib/test.js +++ b/lib/test.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle").cmd("test") +module.exports = require("./utils/lifecycle.js").cmd("test") diff --git a/lib/unbuild.js b/lib/unbuild.js index 64e358a81..4903f154a 100644 --- a/lib/unbuild.js +++ b/lib/unbuild.js @@ -1,16 +1,16 @@ module.exports = unbuild unbuild.usage = "npm unbuild <folder>\n(this is plumbing)" -var readJson = require("./utils/read-json") - , rm = require("./utils/rm-rf") - , npm = require("../npm") +var readJson = require("./utils/read-json.js") + , rm = require("./utils/rm-rf.js") + , npm = require("../npm.js") , path = require("path") , fs = require("graceful-fs") - , lifecycle = require("./utils/lifecycle") + , lifecycle = require("./utils/lifecycle.js") , asyncMap = require("slide").asyncMap , chain = require("slide").chain - , log = require("./utils/log") - , build = require("./build") + , log = require("./utils/log.js") + , build = require("./build.js") // args is a list of folders. // remove any bins/etc, and then delete the folder. diff --git a/lib/uninstall.js b/lib/uninstall.js index 846bf8b29..99526bf77 100644 --- a/lib/uninstall.js +++ b/lib/uninstall.js @@ -8,14 +8,14 @@ module.exports = uninstall uninstall.usage = "npm uninstall <name>[@<version> [<name>[@<version>] ...]" + "\nnpm rm <name>[@<version> [<name>[@<version>] ...]" -uninstall.completion = require("./utils/completion/installed-shallow") +uninstall.completion = require("./utils/completion/installed-shallow.js") -var rm = require("./utils/rm-rf") +var rm = require("./utils/rm-rf.js") , fs = require("graceful-fs") - , log = require("./utils/log") - , readJson = require("./utils/read-json") + , log = require("./utils/log.js") + , readJson = require("./utils/read-json.js") , path = require("path") - , npm = require("../npm") + , npm = require("../npm.js") , semver = require("semver") , asyncMap = require("slide").asyncMap diff --git a/lib/unpublish.js b/lib/unpublish.js index 71dcbba82..41af591cb 100644 --- a/lib/unpublish.js +++ b/lib/unpublish.js @@ -1,10 +1,10 @@ module.exports = unpublish -var registry = require("./utils/npm-registry-client") - , log = require("./utils/log") - , npm = require("../npm") - , readJson = require("./utils/read-json") +var registry = require("./utils/npm-registry-client/index.js") + , log = require("./utils/log.js") + , npm = require("../npm.js") + , readJson = require("./utils/read-json.js") , path = require("path") unpublish.usage = "npm unpublish <project>[@<version>]" diff --git a/lib/update.js b/lib/update.js index a4634415b..106e1f5a7 100644 --- a/lib/update.js +++ b/lib/update.js @@ -9,10 +9,10 @@ module.exports = update update.usage = "npm update [pkg]" -var npm = require("../npm") - , lifecycle = require("./utils/lifecycle") +var npm = require("../npm.js") + , lifecycle = require("./utils/lifecycle.js") , asyncMap = require("slide").asyncMap - , log = require("./utils/log") + , log = require("./utils/log.js") update.completion = npm.commands.outdated.completion diff --git a/lib/utils/completion/file-completion.js b/lib/utils/completion/file-completion.js index 1eb879429..427efefb4 100644 --- a/lib/utils/completion/file-completion.js +++ b/lib/utils/completion/file-completion.js @@ -1,7 +1,7 @@ module.exports = fileCompletion -var find = require("../find") - , mkdir = require("../mkdir-p") +var find = require("../find.js") + , mkdir = require("../mkdir-p.js") , path = require("path") function fileCompletion (root, req, depth, cb) { diff --git a/lib/utils/completion/installed-deep.js b/lib/utils/completion/installed-deep.js index 7d6bbdb76..d421ae70e 100644 --- a/lib/utils/completion/installed-deep.js +++ b/lib/utils/completion/installed-deep.js @@ -1,7 +1,7 @@ module.exports = installedDeep -var npm = require("../../../npm") - , readInstalled = require("../read-installed") +var npm = require("../../../npm.js") + , readInstalled = require("../read-installed.js") function installedDeep (opts, cb) { var local diff --git a/lib/utils/completion/installed-shallow.js b/lib/utils/completion/installed-shallow.js index ab2fbb751..d70c299cb 100644 --- a/lib/utils/completion/installed-shallow.js +++ b/lib/utils/completion/installed-shallow.js @@ -1,10 +1,10 @@ module.exports = installedShallow -var npm = require("../../../npm") +var npm = require("../../../npm.js") , fs = require("graceful-fs") , path = require("path") - , readJson = require("../read-json") + , readJson = require("../read-json.js") , asyncMap = require("slide").asyncMap function installedShallow (opts, filter, cb) { diff --git a/lib/utils/completion/remote-packages.js b/lib/utils/completion/remote-packages.js index c2d3bda26..4bf82d070 100644 --- a/lib/utils/completion/remote-packages.js +++ b/lib/utils/completion/remote-packages.js @@ -1,9 +1,9 @@ module.exports = remotePackages -var registry = require("../npm-registry-client") - , containsSingleMatch = require("./contains-single-match") - , getCompletions = require("./get-completions") +var registry = require("../npm-registry-client/index.js") + , containsSingleMatch = require("./contains-single-match.js") + , getCompletions = require("./get-completions.js") /* Looks up remote packages for CLI tab-completion. diff --git a/lib/utils/completion/users.js b/lib/utils/completion/users.js index 5e2bd6cdd..f77312c94 100644 --- a/lib/utils/completion/users.js +++ b/lib/utils/completion/users.js @@ -1,10 +1,10 @@ module.exports = users -var registry = require("../npm-registry-client") - , containsSingleMatch = require("./contains-single-match") - , getCompletions = require("./get-completions") - , log = require("../log") +var registry = require("../npm-registry-client/index.js") + , containsSingleMatch = require("./contains-single-match.js") + , getCompletions = require("./get-completions.js") + , log = require("../log.js") function users (args, index, cb) { var name = (args.length + 1 === index) ? args[args.length - 1] : "" diff --git a/lib/utils/config-defs.js b/lib/utils/config-defs.js index 0df2e98ae..fc5ec8f0a 100644 --- a/lib/utils/config-defs.js +++ b/lib/utils/config-defs.js @@ -9,7 +9,7 @@ var path = require("path") , stableFamily = semver.parse(process.version) , os = require("os") , nopt = require("nopt") - , log = require("./log") + , log = require("./log.js") nopt.typeDefs.semver = { type: semver, validate: validateSemver } function validateSemver (data, k, val) { diff --git a/lib/utils/error-handler.js b/lib/utils/error-handler.js index fcdbb5e5c..d27a2c842 100644 --- a/lib/utils/error-handler.js +++ b/lib/utils/error-handler.js @@ -2,9 +2,9 @@ module.exports = errorHandler var cbCalled = false - , log = require("./log") - , npm = require("../../npm") - , rm = require("./rm-rf") + , log = require("./log.js") + , npm = require("../../npm.js") + , rm = require("./rm-rf.js") , constants = require("constants") , itWorked = false , path = require("path") diff --git a/lib/utils/excludes.js b/lib/utils/excludes.js index 49c66ef6e..6df89ccaf 100644 --- a/lib/utils/excludes.js +++ b/lib/utils/excludes.js @@ -26,8 +26,8 @@ exports.filter = filter var path = require("path") , fs = require("graceful-fs") , minimatch = require("minimatch") - , relativize = require("./relativize") - , log = require("./log") + , relativize = require("./relativize.js") + , log = require("./log.js") // todo: memoize diff --git a/lib/utils/exec.js b/lib/utils/exec.js index 607665f33..0a98857ea 100644 --- a/lib/utils/exec.js +++ b/lib/utils/exec.js @@ -3,10 +3,10 @@ module.exports = exec exec.spawn = spawn exec.pipe = pipe -var log = require("./log") +var log = require("./log.js") , child_process = require("child_process") , util = require("util") - , npm = require("../../npm") + , npm = require("../../npm.js") , myUID = process.getuid ? process.getuid() : null , myGID = process.getgid ? process.getgid() : null , isRoot = process.getuid && myUID === 0 diff --git a/lib/utils/fetch.js b/lib/utils/fetch.js index 8168fa840..3981dbca6 100644 --- a/lib/utils/fetch.js +++ b/lib/utils/fetch.js @@ -7,14 +7,14 @@ var http , url = require("url") , util = require("util") , fs = require("graceful-fs") - , get = require("./get") - , set = require("./set") - , log = require("./log") - , npm = require("../../npm") + , get = require("./get.js") + , set = require("./set.js") + , log = require("./log.js") + , npm = require("../../npm.js") , path = require("path") - , mkdir = require("./mkdir-p") + , mkdir = require("./mkdir-p.js") , consts = require("constants") - , proxyify = require("./proxyify") + , proxyify = require("./proxyify.js") , regUrl module.exports = fetch @@ -117,7 +117,7 @@ function fetchAndWrite (remote, fstr, headers, maxRedirects, redirects) { if (module === require.main) { log("testing", "fetch") -var exec = require("./exec") +var exec = require("./exec.js") , urls = [ "http://github.com/isaacs/npm/tarball/master" , "http://registry.npmjs.org/npm/-/npm-0.2.18.tgz" diff --git a/lib/utils/find-prefix.js b/lib/utils/find-prefix.js index aa097bc1c..c67c9a978 100644 --- a/lib/utils/find-prefix.js +++ b/lib/utils/find-prefix.js @@ -4,7 +4,7 @@ module.exports = findPrefix var fs = require("graceful-fs") , path = require("path") - , npm = require("../../npm") + , npm = require("../../npm.js") function findPrefix (p, cb) { p = path.resolve(p) diff --git a/lib/utils/ini.js b/lib/utils/ini.js index 5a59fd9f2..2a4beda8f 100644 --- a/lib/utils/ini.js +++ b/lib/utils/ini.js @@ -32,13 +32,13 @@ var fs = require("graceful-fs") , path = require("path") , privateKey = null - , log = require("./log") - , ini = require("./ini-parser") - , base64 = require("./base64") - , ProtoList = require("./proto-list") + , log = require("./log.js") + , ini = require("./ini-parser.js") + , base64 = require("./base64.js") + , ProtoList = require("./proto-list.js") , defaultConfig , configList = new ProtoList() - , configDefs = require("./config-defs") + , configDefs = require("./config-defs.js") , types = configDefs.types , TRANS = exports.TRANS = { "default" : 4 diff --git a/lib/utils/lifecycle.js b/lib/utils/lifecycle.js index 444a7041b..4062c9163 100644 --- a/lib/utils/lifecycle.js +++ b/lib/utils/lifecycle.js @@ -2,15 +2,15 @@ exports = module.exports = lifecycle exports.cmd = cmd -var log = require("./log") - , exec = require("./exec") - , npm = require("../../npm") +var log = require("./log.js") + , exec = require("./exec.js") + , npm = require("../../npm.js") , path = require("path") - , readJson = require("./read-json") + , readJson = require("./read-json.js") , fs = require("graceful-fs") , chain = require("slide").chain , constants = require("constants") - , output = require("./output") + , output = require("./output.js") function lifecycle (pkg, stage, wd, unsafe, cb) { if (typeof cb !== "function") cb = unsafe, unsafe = false @@ -238,7 +238,7 @@ function cmd (stage) { } else npm.commands["run-script"]([stage], cb) } CMD.usage = "npm "+stage+" <name>" - var installedShallow = require("./completion/installed-shallow") + var installedShallow = require("./completion/installed-shallow.js") CMD.completion = function (opts, cb) { installedShallow(opts, function (d) { return d.scripts && d.scripts[stage] diff --git a/lib/utils/link.js b/lib/utils/link.js index 241e0734e..586450e6f 100644 --- a/lib/utils/link.js +++ b/lib/utils/link.js @@ -4,12 +4,12 @@ link.ifExists = linkIfExists var fs = require("graceful-fs") , chain = require("slide").chain - , mkdir = require("./mkdir-p") - , rm = require("./rm-rf") - , log = require("./log") + , mkdir = require("./mkdir-p.js") + , rm = require("./rm-rf.js") + , log = require("./log.js") , path = require("path") - , relativize = require("./relativize") - , npm = require("../../npm") + , relativize = require("./relativize.js") + , npm = require("../../npm.js") function linkIfExists (from, to, gently, cb) { fs.stat(from, function (er) { diff --git a/lib/utils/load-package-defaults.js b/lib/utils/load-package-defaults.js index 6c537115b..a5766a4e1 100644 --- a/lib/utils/load-package-defaults.js +++ b/lib/utils/load-package-defaults.js @@ -2,10 +2,10 @@ module.exports = loadPackageDefaults var path = require("path") - , log = require("./log") - , find = require("./find") + , log = require("./log.js") + , find = require("./find.js") , asyncMap = require("slide").asyncMap - , npm = require("../../npm") + , npm = require("../../npm.js") , fs = require("graceful-fs") function loadPackageDefaults (pkg, pkgDir, cb) { diff --git a/lib/utils/log.js b/lib/utils/log.js index 11e5839c5..87f5b95ce 100644 --- a/lib/utils/log.js +++ b/lib/utils/log.js @@ -18,7 +18,7 @@ silent quiets everything module.exports = log -var output = require("./output") +var output = require("./output.js") function colorize (msg, color) { return msg ? "\033["+color+"m"+msg+"\033[0m" : "" @@ -66,14 +66,14 @@ COLOR.npm = "37;40" COLOR.pref = 35 var logBuffer = [] - , ini = require("./ini") + , ini = require("./ini.js") , waitForConfig log.waitForConfig = function () { waitForConfig = true } // now the required stuff has been loaded, // so the transitive module dep will work var util = require("util") - , npm = require("../../npm") + , npm = require("../../npm.js") , net = require("net") Object.defineProperty(log, "level", diff --git a/lib/utils/mkdir-p.js b/lib/utils/mkdir-p.js index 4bf196fd5..150d41ac4 100644 --- a/lib/utils/mkdir-p.js +++ b/lib/utils/mkdir-p.js @@ -1,10 +1,10 @@ -var log = require("./log") +var log = require("./log.js") , fs = require("graceful-fs") , path = require("path") - , npm = require("../../npm") - , exec = require("./exec") - , uidNumber = require("./uid-number") + , npm = require("../../npm.js") + , exec = require("./exec.js") + , uidNumber = require("./uid-number.js") , umask = process.umask() , umaskOrig = umask , addedUmaskExit = false diff --git a/lib/utils/npm-registry-client/adduser.js b/lib/utils/npm-registry-client/adduser.js index 8d830dbe2..d364f06bd 100644 --- a/lib/utils/npm-registry-client/adduser.js +++ b/lib/utils/npm-registry-client/adduser.js @@ -2,10 +2,10 @@ module.exports = adduser var uuid = require("node-uuid") - , request = require("./request") - , log = require("../log") - , base64 = require("../base64") - , npm = require("../../../npm") + , request = require("./request.js") + , log = require("../log.js") + , base64 = require("../base64.js") + , npm = require("../../../npm.js") , crypto try { diff --git a/lib/utils/npm-registry-client/get.js b/lib/utils/npm-registry-client/get.js index a879524e9..32a60ca85 100644 --- a/lib/utils/npm-registry-client/get.js +++ b/lib/utils/npm-registry-client/get.js @@ -1,12 +1,12 @@ module.exports = get -var GET = require("./request").GET +var GET = require("./request.js").GET , fs = require("graceful-fs") - , npm = require("../../../npm") + , npm = require("../../../npm.js") , path = require("path") - , log = require("../log") - , mkdir = require("../mkdir-p") + , log = require("../log.js") + , mkdir = require("../mkdir-p.js") , cacheStat = null function get (project, version, timeout, nofollow, staleOk, cb) { diff --git a/lib/utils/npm-registry-client/index.js b/lib/utils/npm-registry-client/index.js index 71412a346..b940f32c0 100644 --- a/lib/utils/npm-registry-client/index.js +++ b/lib/utils/npm-registry-client/index.js @@ -3,7 +3,7 @@ var cached = {} function lazyGet (p) { return function () { - return cached[p] || (cached[p] = require("./"+p)) + return cached[p] || (cached[p] = require("./"+p+".js")) }} function setLazyGet (p) { diff --git a/lib/utils/npm-registry-client/publish.js b/lib/utils/npm-registry-client/publish.js index 9a4b88a58..4584646c3 100644 --- a/lib/utils/npm-registry-client/publish.js +++ b/lib/utils/npm-registry-client/publish.js @@ -1,15 +1,15 @@ module.exports = publish -var request = require("./request") +var request = require("./request.js") , GET = request.GET , PUT = request.PUT , DELETE = request.DELETE , reg = request.reg , upload = request.upload - , log = require("../log") + , log = require("../log.js") , path = require("path") - , npm = require("../../../npm") + , npm = require("../../../npm.js") , url = require("url") function publish (data, prebuilt, cb) { diff --git a/lib/utils/npm-registry-client/request.js b/lib/utils/npm-registry-client/request.js index 9c295309f..0fa09d73d 100644 --- a/lib/utils/npm-registry-client/request.js +++ b/lib/utils/npm-registry-client/request.js @@ -5,16 +5,16 @@ request.PUT = PUT request.reg = reg request.upload = upload -var npm = require("../../../npm") +var npm = require("../../../npm.js") , http , https , url = require("url") - , log = require("../log") - , ini = require("../ini") + , log = require("../log.js") + , ini = require("../ini.js") , fs = require("graceful-fs") - , rm = require("../rm-rf") + , rm = require("../rm-rf.js") , asyncMap = require("slide").asyncMap - , proxyify = require("../proxyify") + , proxyify = require("../proxyify.js") , warnedAuth = false , newloctimeout = 0 diff --git a/lib/utils/npm-registry-client/tag.js b/lib/utils/npm-registry-client/tag.js index ef2a4d007..c24bc62e7 100644 --- a/lib/utils/npm-registry-client/tag.js +++ b/lib/utils/npm-registry-client/tag.js @@ -1,7 +1,7 @@ module.exports = tag -var PUT = require("./request").PUT +var PUT = require("./request.js").PUT function tag (project, version, tag, cb) { PUT(project+"/"+tag, version, cb) diff --git a/lib/utils/npm-registry-client/unpublish.js b/lib/utils/npm-registry-client/unpublish.js index 4c67e08ea..0c7c44991 100644 --- a/lib/utils/npm-registry-client/unpublish.js +++ b/lib/utils/npm-registry-client/unpublish.js @@ -7,9 +7,9 @@ module.exports = unpublish -var request = require("./request") - , log = require("../log") - , get = require("./get") +var request = require("./request.js") + , log = require("../log.js") + , get = require("./get.js") , semver = require("semver") , url = require("url") , chain = require("slide").chain diff --git a/lib/utils/output.js b/lib/utils/output.js index 9df4aaff0..b266f20ca 100644 --- a/lib/utils/output.js +++ b/lib/utils/output.js @@ -4,7 +4,7 @@ exports.doColor = doColor exports.write = write -var npm = require("../../npm") +var npm = require("../../npm.js") , stdio = process.binding("stdio") , streams = {} , ttys = {} diff --git a/lib/utils/prompt.js b/lib/utils/prompt.js index 5c5ada8e4..9ed923af8 100644 --- a/lib/utils/prompt.js +++ b/lib/utils/prompt.js @@ -1,7 +1,7 @@ module.exports = prompt -var log = require("./log") +var log = require("./log.js") , buffer = "" , stdio = process.binding("stdio") diff --git a/lib/utils/read-installed.js b/lib/utils/read-installed.js index 919eda3e0..b49ae39de 100644 --- a/lib/utils/read-installed.js +++ b/lib/utils/read-installed.js @@ -87,13 +87,13 @@ as far as the left-most node_modules folder. */ -var npm = require("../../npm") +var npm = require("../../npm.js") , fs = require("graceful-fs") , path = require("path") , asyncMap = require("slide").asyncMap , semver = require("semver") - , readJson = require("./read-json") - , log = require("./log") + , readJson = require("./read-json.js") + , log = require("./log.js") module.exports = readInstalled diff --git a/lib/utils/read-json.js b/lib/utils/read-json.js index 5cbd43865..992a88905 100644 --- a/lib/utils/read-json.js +++ b/lib/utils/read-json.js @@ -7,11 +7,11 @@ readJson.parsePeople = parsePeople var fs = require("graceful-fs") , semver = require("semver") , path = require("path") - , log = require("./log") - , npm = require("../../npm") + , log = require("./log.js") + , npm = require("../../npm.js") , cache = {} , timers = {} - , loadPackageDefaults = require("./load-package-defaults") + , loadPackageDefaults = require("./load-package-defaults.js") function readJson (jsonFile, opts, cb) { if (typeof cb !== "function") cb = opts, opts = {} diff --git a/lib/utils/rm-rf.js b/lib/utils/rm-rf.js index ae9ed190e..ed889634f 100644 --- a/lib/utils/rm-rf.js +++ b/lib/utils/rm-rf.js @@ -6,7 +6,7 @@ module.exports = rm var fs = require("graceful-fs") , path = require("path") , failedToRemove = [] - , log = require("./log") + , log = require("./log.js") , constants = require("constants") process.on("exit", function () { diff --git a/lib/utils/set.js b/lib/utils/set.js index 4ab845915..4d9241aab 100644 --- a/lib/utils/set.js +++ b/lib/utils/set.js @@ -1,7 +1,7 @@ module.exports = set -var get = require("./get") - , processJson = require("./read-json").processJson +var get = require("./get.js") + , processJson = require("./read-json.js").processJson function set (obj, key, val) { for (var i in obj) { if (i.toLowerCase() === key.toLowerCase()) return obj[i] = val diff --git a/lib/utils/sha.js b/lib/utils/sha.js index 9a54a4d74..17b8c38f9 100644 --- a/lib/utils/sha.js +++ b/lib/utils/sha.js @@ -1,7 +1,7 @@ var fs = require("graceful-fs") , crypto = require("crypto") - , log = require("./log") + , log = require("./log.js") , binding try { binding = process.binding("crypto") } diff --git a/lib/utils/tar.js b/lib/utils/tar.js index 0b25c5576..90e42fa58 100644 --- a/lib/utils/tar.js +++ b/lib/utils/tar.js @@ -3,22 +3,22 @@ var FMODE = exports.FMODE = 0644 , DMODE = exports.DMODE = 0755 - , npm = require("../../npm") + , npm = require("../../npm.js") , fs = require("graceful-fs") - , exec = require("./exec") + , exec = require("./exec.js") , spawn = exec.spawn , pipe = exec.pipe - , find = require("./find") - , mkdir = require("./mkdir-p") + , find = require("./find.js") + , mkdir = require("./mkdir-p.js") , asyncMap = require("slide").asyncMap , path = require("path") - , log = require("./log") - , uidNumber = require("./uid-number") - , rm = require("./rm-rf") - , readJson = require("./read-json") - , relativize = require("./relativize") - , cache = require("../cache") - , excludes = require("./excludes") + , log = require("./log.js") + , uidNumber = require("./uid-number.js") + , rm = require("./rm-rf.js") + , readJson = require("./read-json.js") + , relativize = require("./relativize.js") + , cache = require("../cache.js") + , excludes = require("./excludes.js") exports.pack = pack exports.unpack = unpack diff --git a/lib/utils/uid-number.js b/lib/utils/uid-number.js index 59952ffd0..ed11ec83f 100644 --- a/lib/utils/uid-number.js +++ b/lib/utils/uid-number.js @@ -5,11 +5,11 @@ module.exports = uidNumber // numeric value. This can't be done in the main node process, // because otherwise npm would be running as that user. -var exec = require("./exec") +var exec = require("./exec.js") , path = require("path") - , log = require("./log") + , log = require("./log.js") , constants = require("constants") - , npm = require("../../npm") + , npm = require("../../npm.js") , uidSupport = process.getuid && process.setuid , uidCache = {} , gidCache = {} diff --git a/lib/version.js b/lib/version.js index 119d501d2..77aaa0ec6 100644 --- a/lib/version.js +++ b/lib/version.js @@ -2,14 +2,14 @@ module.exports = version -var exec = require("./utils/exec") - , readJson = require("./utils/read-json") +var exec = require("./utils/exec.js") + , readJson = require("./utils/read-json.js") , semver = require("semver") , path = require("path") , fs = require("graceful-fs") , chain = require("slide").chain - , log = require("./utils/log") - , npm = require("../npm") + , log = require("./utils/log.js") + , npm = require("../npm.js") version.usage = "npm version <newversion>\n(run in package dir)\n" + "'npm -v' or 'npm --version' to print npm version " diff --git a/lib/view.js b/lib/view.js index 842888bbe..3b4dcabb1 100644 --- a/lib/view.js +++ b/lib/view.js @@ -39,14 +39,14 @@ view.completion = function (opts, cb) { } } -var registry = require("./utils/npm-registry-client") - , ini = require("./utils/ini-parser") - , log = require("./utils/log") +var registry = require("./utils/npm-registry-client/index.js") + , ini = require("./utils/ini-parser.js") + , log = require("./utils/log.js") , util = require("util") , output - , npm = require("../npm") + , npm = require("../npm.js") , semver = require("semver") - , readJson = require("./utils/read-json") + , readJson = require("./utils/read-json.js") function view (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false @@ -174,7 +174,7 @@ function printData (data, cb) { msg += (showVersions ? v + " " : "") + (showFields ? f : "") + d + "\n" }) }) - output = output || require("./utils/output") + output = output || require("./utils/output.js") output.write(msg, cb_) } function cleanup (data) { diff --git a/lib/whoami.js b/lib/whoami.js index c3931f938..984e3ad66 100644 --- a/lib/whoami.js +++ b/lib/whoami.js @@ -1,8 +1,8 @@ module.exports = whoami -var npm = require("../npm") - , output = require("./utils/output") - , log = require("./utils/log") +var npm = require("../npm.js") + , output = require("./utils/output.js") + , log = require("./utils/log.js") whoami.usage = "npm whoami\n(just prints the 'username' config)" diff --git a/lib/xmas.js b/lib/xmas.js index 1ee320b4e..429b34aae 100644 --- a/lib/xmas.js +++ b/lib/xmas.js @@ -1,6 +1,7 @@ // happy xmas -var npm = require("../npm") - , log = require("./utils/log") +var npm = require("../npm.js") + , log = require("./utils/log.js") + module.exports = function (args, cb) { npm.config.set("loglevel", "win") var s = " \u2605" |