Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Avoid accidentally opening npm.js with WSH

  • Loading branch information...
commit 4eb8f6b7bfced57ce8415e98a632af5c5317011c 1 parent f2b9b5d
@isaacs isaacs authored
Showing with 107 additions and 94 deletions.
  1. +1 −1  README.md
  2. +17 −5 bin/{npm.js → npm-cli.js}
  3. +0 −1  bin/npm.cmd
  4. +1 −1  cli.js
  5. +1 −1  lib/adduser.js
  6. +1 −1  lib/bin.js
  7. +1 −1  lib/bugs.js
  8. +1 −1  lib/build.js
  9. +1 −1  lib/cache.js
  10. +1 −1  lib/completion.js
  11. +1 −1  lib/config.js
  12. +1 −1  lib/deprecate.js
  13. +1 −1  lib/docs.js
  14. +1 −1  lib/edit.js
  15. +1 −1  lib/explore.js
  16. +1 −1  lib/faq.js
  17. +1 −1  lib/get.js
  18. +1 −1  lib/help-search.js
  19. +1 −1  lib/help.js
  20. +1 −1  lib/init.js
  21. +1 −1  lib/install.js
  22. +1 −1  lib/link.js
  23. +1 −1  lib/ls.js
  24. +13 −12 { → lib}/npm.js
  25. +1 −1  lib/outdated.js
  26. +1 −1  lib/owner.js
  27. +1 −1  lib/pack.js
  28. +1 −1  lib/prefix.js
  29. +1 −1  lib/prune.js
  30. +1 −1  lib/publish.js
  31. +1 −1  lib/rebuild.js
  32. +1 −1  lib/root.js
  33. +1 −1  lib/run-script.js
  34. +1 −1  lib/search.js
  35. +1 −1  lib/set.js
  36. +1 −1  lib/star.js
  37. +1 −1  lib/submodule.js
  38. +1 −1  lib/tag.js
  39. +1 −1  lib/unbuild.js
  40. +1 −1  lib/uninstall.js
  41. +1 −1  lib/unpublish.js
  42. +1 −1  lib/update.js
  43. +1 −1  lib/utils/cmd-shim.js
  44. +1 −1  lib/utils/completion/installed-deep.js
  45. +1 −1  lib/utils/completion/installed-shallow.js
  46. +1 −1  lib/utils/error-handler.js
  47. +1 −1  lib/utils/exec.js
  48. +1 −1  lib/utils/fetch.js
  49. +1 −1  lib/utils/find-prefix.js
  50. +1 −1  lib/utils/get-agent.js
  51. +1 −1  lib/utils/lifecycle.js
  52. +1 −1  lib/utils/link.js
  53. +1 −1  lib/utils/load-package-defaults.js
  54. +1 −1  lib/utils/log.js
  55. +1 −1  lib/utils/mkdir-p.js
  56. +1 −1  lib/utils/npm-registry-client/adduser.js
  57. +1 −1  lib/utils/npm-registry-client/get.js
  58. +1 −1  lib/utils/npm-registry-client/publish.js
  59. +1 −1  lib/utils/npm-registry-client/request.js
  60. +1 −1  lib/utils/npm-registry-client/star.js
  61. +1 −1  lib/utils/output.js
  62. +1 −1  lib/utils/read-installed.js
  63. +1 −1  lib/utils/read-json.js
  64. +1 −1  lib/utils/tar.js
  65. +1 −1  lib/utils/uid-number.js
  66. +1 −1  lib/version.js
  67. +1 −1  lib/view.js
  68. +1 −1  lib/whoami.js
  69. +8 −7 lib/xmas.js
  70. +4 −4 package.json
View
2  README.md
@@ -206,7 +206,7 @@ You cannot set configs individually for any single npm function at this
time. Since `npm` is a singleton, any call to `npm.config.set` will
change the value for *all* npm commands in that process.
-See `./bin/npm.js` for an example of pulling config values off of the
+See `./bin/npm-cli.js` for an example of pulling config values off of the
command line arguments using nopt. You may also want to check out `npm
help config` to learn about all the options you can set there.
View
22 bin/npm.js → bin/npm-cli.js
@@ -1,16 +1,28 @@
#!/usr/bin/env node
;(function () { // wrapper in case we're in module_context mode
-var log = require("../lib/utils/log")
+
+// windows: running "npm blah" in this folder will invoke WSH, not node.
+if (typeof WScript !== "undefined") {
+ WScript.echo("npm does not work when run\n"
+ +"with the Windows Scripting Host\n\n"
+ +"'cd' to a different directory,\n"
+ +"or type 'npm.cmd <args>',\n"
+ +"or type 'node npm <args>'.")
+ WScript.quit(1)
+ return
+}
+
+var log = require("../lib/utils/log.js")
log.waitForConfig()
log.info("ok", "it worked if it ends with")
var fs = require("graceful-fs")
, path = require("path")
- , npm = require("../npm")
- , ini = require("../lib/utils/ini")
- , errorHandler = require("../lib/utils/error-handler")
+ , npm = require("../lib/npm.js")
+ , ini = require("../lib/utils/ini.js")
+ , errorHandler = require("../lib/utils/error-handler.js")
- , configDefs = require("../lib/utils/config-defs")
+ , configDefs = require("../lib/utils/config-defs.js")
, shorthands = configDefs.shorthands
, types = configDefs.types
, nopt = require("nopt")
View
1  bin/npm.cmd
@@ -1 +0,0 @@
-@node %~dp0\..\npm.js %*
View
2  cli.js
@@ -1,2 +1,2 @@
#!/usr/bin/env node
-require("./bin/npm.js")
+require("./bin/npm-cli.js")
View
2  lib/adduser.js
@@ -4,7 +4,7 @@ module.exports = adduser
var registry = require("./utils/npm-registry-client/index.js")
, ini = require("./utils/ini.js")
, log = require("./utils/log.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, prompt = require("./utils/prompt.js")
, promiseChain = require("./utils/promise-chain.js")
, crypto
View
2  lib/bin.js
@@ -1,6 +1,6 @@
module.exports = bin
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, output = require("./utils/output.js")
bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)"
View
2  lib/bugs.js
@@ -12,7 +12,7 @@ bugs.completion = function (opts, cb) {
var exec = require("./utils/exec.js")
, registry = require("./utils/npm-registry-client/index.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, log = require("./utils/log.js")
function bugs (args, cb) {
View
2  lib/build.js
@@ -8,7 +8,7 @@
// This runs AFTER install or link are completed.
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, log = require("./utils/log.js")
, chain = require("slide").chain
, fs = require("graceful-fs")
View
2  lib/cache.js
@@ -34,7 +34,7 @@ exports.unpack = unpack
var mkdir = require("./utils/mkdir-p.js")
, exec = require("./utils/exec.js")
, fetch = require("./utils/fetch.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, fs = require("graceful-fs")
, rm = require("rimraf")
, readJson = require("./utils/read-json.js")
View
2  lib/completion.js
@@ -15,7 +15,7 @@ var output = require("./utils/output.js")
})
, shorthandNames = Object.keys(shorthands)
, allConfs = configNames.concat(shorthandNames)
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
completion.completion = function (opts, cb) {
if (opts.w > 3) return cb()
View
2  lib/config.js
@@ -9,7 +9,7 @@ config.usage = "npm config set <key> <value>"
var ini = require("./utils/ini.js")
, log = require("./utils/log.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, exec = require("./utils/exec.js")
, fs = require("graceful-fs")
, dc
View
2  lib/deprecate.js
@@ -21,7 +21,7 @@ deprecate.completion = function (opts, cb) {
var registry = require("./utils/npm-registry-client/index.js")
, semver = require("semver")
, log = require("./utils/log.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
function deprecate (args, cb) {
var pkg = args[0]
View
2  lib/docs.js
@@ -12,7 +12,7 @@ docs.completion = function (opts, cb) {
var exec = require("./utils/exec.js")
, registry = require("./utils/npm-registry-client/index.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, log = require("./utils/log.js")
function docs (args, cb) {
View
2  lib/edit.js
@@ -6,7 +6,7 @@ edit.usage = "npm edit <pkg>"
edit.completion = require("./utils/completion/installed-shallow.js")
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, exec = require("./utils/exec.js")
, path = require("path")
, fs = require("graceful-fs")
View
2  lib/explore.js
@@ -5,7 +5,7 @@ module.exports = explore
explore.usage = "npm explore <pkg> [ -- <cmd>]"
explore.completion = require("./utils/completion/installed-shallow.js")
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, exec = require("./utils/exec.js")
, path = require("path")
, fs = require("graceful-fs")
View
2  lib/faq.js
@@ -3,6 +3,6 @@ module.exports = faq
faq.usage = "npm faq"
-var npm = require("../npm.js")
+var npm = require("./npm.js")
function faq (args, cb) { npm.commands.help(["faq"], cb) }
View
2  lib/get.js
@@ -3,7 +3,7 @@ module.exports = get
get.usage = "npm get <key> <value> (See `npm config`)"
-var npm = require("../npm.js")
+var npm = require("./npm.js")
get.completion = npm.commands.config.completion
View
2  lib/help-search.js
@@ -8,7 +8,7 @@ var fs = require("graceful-fs")
, cliDocsPath = path.join(__dirname, "..", "doc", "cli")
, apiDocsPath = path.join(__dirname, "..", "doc", "api")
, log = require("./utils/log.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
helpSearch.usage = "npm help-search <text>"
View
2  lib/help.js
@@ -11,7 +11,7 @@ help.completion = function (opts, cb) {
var fs = require("graceful-fs")
, path = require("path")
, exec = require("./utils/exec.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, output = require("./utils/output.js")
, log = require("./utils/log.js")
View
2  lib/init.js
@@ -11,7 +11,7 @@ var prompt = require("./utils/prompt.js")
, exec = require("./utils/exec.js")
, semver = require("semver")
, log = require("./utils/log.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, output = require("./utils/output.js")
init.usage = "npm init [folder]"
View
2  lib/install.js
@@ -52,7 +52,7 @@ install.completion = function (opts, cb) {
})
}
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, semver = require("semver")
, readJson = require("./utils/read-json.js")
, log = require("./utils/log.js")
View
2  lib/link.js
@@ -2,7 +2,7 @@
// 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.js")
+var npm = require("./npm.js")
, symlink = require("./utils/link.js")
, fs = require("graceful-fs")
, log = require("./utils/log.js")
View
2  lib/ls.js
@@ -7,7 +7,7 @@
module.exports = exports = ls
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, readInstalled = require("./utils/read-installed.js")
, output = require("./utils/output.js")
, log = require("./utils/log.js")
View
25 npm.js → lib/npm.js
@@ -19,19 +19,19 @@ require("path").SPLIT_CHAR = process.platform === "win32" ? "\\" : "/"
var EventEmitter = require("events").EventEmitter
, npm = module.exports = new EventEmitter
- , config = require("./lib/config.js")
- , set = require("./lib/utils/set.js")
- , get = require("./lib/utils/get.js")
- , ini = require("./lib/utils/ini.js")
- , log = require("./lib/utils/log.js")
+ , config = require("./config.js")
+ , set = require("./utils/set.js")
+ , get = require("./utils/get.js")
+ , ini = require("./utils/ini.js")
+ , log = require("./utils/log.js")
, fs = require("graceful-fs")
, path = require("path")
, abbrev = require("abbrev")
, which = require("which")
, semver = require("semver")
- , findPrefix = require("./lib/utils/find-prefix.js")
- , getUid = require("./lib/utils/uid-number.js")
- , mkdir = require("./lib/utils/mkdir-p.js")
+ , findPrefix = require("./utils/find-prefix.js")
+ , getUid = require("./utils/uid-number.js")
+ , mkdir = require("./utils/mkdir-p.js")
npm.commands = {}
npm.ELIFECYCLE = {}
@@ -68,7 +68,8 @@ if (process.platform === "win32") {
try {
// startup, ok to do this synchronously
- var j = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"))+"")
+ var j = JSON.parse(fs.readFileSync(
+ path.join(__dirname, "../package.json"))+"")
npm.version = j.version
npm.nodeVersionRequired = j.engines.node
if (!semver.satisfies(process.version, j.engines.node)) {
@@ -114,7 +115,7 @@ var commandCache = {}
}
, aliasNames = Object.keys(aliases)
- // these are filenames in ./lib
+ // these are filenames in .
, cmdList = [ "install"
, "uninstall"
, "cache"
@@ -182,7 +183,7 @@ Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) {
}
npm.command = c
if (commandCache[a]) return commandCache[a]
- var cmd = require(__dirname+"/lib/"+a+".js")
+ var cmd = require(__dirname+"/"+a+".js")
commandCache[a] = function () {
var args = Array.prototype.slice.call(arguments, 0)
if (typeof args[args.length - 1] !== "function") {
@@ -391,6 +392,6 @@ Object.getOwnPropertyNames(npm.commands).forEach(function (n) {
})
if (require.main === module) {
- require("./bin/npm.js")
+ require("../bin/npm-cli.js")
}
})()
View
2  lib/outdated.js
@@ -23,7 +23,7 @@ var path = require("path")
, readJson = require("./utils/read-json.js")
, cache = require("./cache.js")
, asyncMap = require("slide").asyncMap
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, log = require("./utils/log.js")
, semver = require("semver")
, relativize = require("./utils/relativize.js")
View
2  lib/owner.js
@@ -69,7 +69,7 @@ var registry = require("./utils/npm-registry-client/index.js")
, put = registry.request.PUT
, log = require("./utils/log.js")
, output
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
function owner (args, cb) {
var action = args.shift()
View
2  lib/pack.js
@@ -4,7 +4,7 @@
module.exports = pack
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, install = require("./install.js")
, cache = require("./cache.js")
, output = require("./utils/output.js")
View
2  lib/prefix.js
@@ -1,6 +1,6 @@
module.exports = prefix
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, output = require("./utils/output.js")
prefix.usage = "npm prefix\nnpm prefix -g\n(just prints the prefix folder)"
View
2  lib/prune.js
@@ -5,7 +5,7 @@ module.exports = prune
prune.usage = "npm prune"
var readInstalled = require("./utils/read-installed.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
prune.completion = require("./utils/completion/installed-deep.js")
View
2  lib/publish.js
@@ -1,7 +1,7 @@
module.exports = publish
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, registry = require("./utils/npm-registry-client/index.js")
, log = require("./utils/log.js")
, tar = require("./utils/tar.js")
View
2  lib/rebuild.js
@@ -5,7 +5,7 @@ var readInstalled = require("./utils/read-installed.js")
, semver = require("semver")
, log = require("./utils/log.js")
, path = require("path")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, output = require("./utils/output.js")
rebuild.usage = "npm rebuild [<name>[@<version>] [name[@<version>] ...]]"
View
2  lib/root.js
@@ -1,6 +1,6 @@
module.exports = root
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, output = require("./utils/output.js")
, log = require("./utils/log.js")
View
2  lib/run-script.js
@@ -2,7 +2,7 @@
module.exports = runScript
var lifecycle = require("./utils/lifecycle.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, path = require("path")
, readJson = require("./utils/read-json.js")
, log = require("./utils/log.js")
View
2  lib/search.js
@@ -1,7 +1,7 @@
module.exports = exports = search
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, registry = require("./utils/npm-registry-client/index.js")
, semver = require("semver")
, output
View
2  lib/set.js
@@ -3,7 +3,7 @@ module.exports = set
set.usage = "npm set <key> <value> (See `npm config`)"
-var npm = require("../npm.js")
+var npm = require("./npm.js")
set.completion = npm.commands.config.completion
View
2  lib/star.js
@@ -1,7 +1,7 @@
module.exports = star
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, registry = require("./utils/npm-registry-client/index.js")
, log = require("./utils/log.js")
, asyncMap = require("slide").asyncMap
View
2  lib/submodule.js
@@ -4,7 +4,7 @@
module.exports = submodule
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, readJson = require("./utils/read-json.js")
, exec = require("./utils/exec.js")
, output = require("./utils/output.js")
View
2  lib/tag.js
@@ -5,7 +5,7 @@ tag.usage = "npm tag <project>@<version> [<tag>]"
tag.completion = require("./unpublish.js").completion
-var npm = require("../npm.js")
+var npm = require("./npm.js")
function tag (args, cb) {
var thing = (args.shift() || "").split("@")
View
2  lib/unbuild.js
@@ -3,7 +3,7 @@ unbuild.usage = "npm unbuild <folder>\n(this is plumbing)"
var readJson = require("./utils/read-json.js")
, rm = require("rimraf")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, path = require("path")
, fs = require("graceful-fs")
, lifecycle = require("./utils/lifecycle.js")
View
2  lib/uninstall.js
@@ -12,7 +12,7 @@ var fs = require("graceful-fs")
, log = require("./utils/log.js")
, readJson = require("./utils/read-json.js")
, path = require("path")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, semver = require("semver")
, asyncMap = require("slide").asyncMap
View
2  lib/unpublish.js
@@ -3,7 +3,7 @@ module.exports = unpublish
var registry = require("./utils/npm-registry-client/index.js")
, log = require("./utils/log.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, readJson = require("./utils/read-json.js")
, path = require("path")
View
2  lib/update.js
@@ -9,7 +9,7 @@ module.exports = update
update.usage = "npm update [pkg]"
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, lifecycle = require("./utils/lifecycle.js")
, asyncMap = require("slide").asyncMap
, log = require("./utils/log.js")
View
2  lib/utils/cmd-shim.js
@@ -19,7 +19,7 @@ var fs = require("graceful-fs")
, log = require("./log.js")
, path = require("path")
, relativize = require("./relativize.js")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, shebangExpr = /^#\!(?:\/usr\/bin\/env )?([^ \t]+)(.*)$/
function cmdShimIfExists (from, to, cb) {
View
2  lib/utils/completion/installed-deep.js
@@ -1,6 +1,6 @@
module.exports = installedDeep
-var npm = require("../../../npm.js")
+var npm = require("../../npm.js")
, readInstalled = require("../read-installed.js")
function installedDeep (opts, cb) {
View
2  lib/utils/completion/installed-shallow.js
@@ -1,7 +1,7 @@
module.exports = installedShallow
-var npm = require("../../../npm.js")
+var npm = require("../../npm.js")
, fs = require("graceful-fs")
, path = require("path")
, readJson = require("../read-json.js")
View
2  lib/utils/error-handler.js
@@ -3,7 +3,7 @@ module.exports = errorHandler
var cbCalled = false
, log = require("./log.js")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, rm = require("rimraf")
, constants = require("constants")
, itWorked = false
View
2  lib/utils/exec.js
@@ -6,7 +6,7 @@ exec.pipe = pipe
var log = require("./log.js")
, child_process = require("child_process")
, util = require("util")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, myUID = process.getuid ? process.getuid() : null
, myGID = process.getgid ? process.getgid() : null
, isRoot = process.getuid && myUID === 0
View
2  lib/utils/fetch.js
@@ -4,7 +4,7 @@
var request = require("request")
, fs = require("graceful-fs")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, url = require("url")
, log = require("./log.js")
, path = require("path")
View
2  lib/utils/find-prefix.js
@@ -4,7 +4,7 @@ module.exports = findPrefix
var fs = require("graceful-fs")
, path = require("path")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
function findPrefix (p, cb) {
p = path.resolve(p)
View
2  lib/utils/get-agent.js
@@ -9,7 +9,7 @@
module.exports = getAgent
-var npm = require("../../npm.js")
+var npm = require("../npm.js")
, url = require("url")
, agents = {}
, isHttp2 = !!require("http").globalAgent
View
2  lib/utils/lifecycle.js
@@ -4,7 +4,7 @@ exports.cmd = cmd
var log = require("./log.js")
, exec = require("./exec.js")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, path = require("path")
, readJson = require("./read-json.js")
, fs = require("graceful-fs")
View
2  lib/utils/link.js
@@ -9,7 +9,7 @@ var fs = require("graceful-fs")
, log = require("./log.js")
, path = require("path")
, relativize = require("./relativize.js")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
function linkIfExists (from, to, gently, cb) {
fs.stat(from, function (er) {
View
2  lib/utils/load-package-defaults.js
@@ -5,7 +5,7 @@ var path = require("path")
, log = require("./log.js")
, find = require("./find.js")
, asyncMap = require("slide").asyncMap
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, fs = require("graceful-fs")
function loadPackageDefaults (pkg, pkgDir, cb) {
View
2  lib/utils/log.js
@@ -73,7 +73,7 @@ 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.js")
+ , npm = require("../npm.js")
, net = require("net")
Object.defineProperty(log, "level",
View
2  lib/utils/mkdir-p.js
@@ -2,7 +2,7 @@
var log = require("./log.js")
, fs = require("graceful-fs")
, path = require("path")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, exec = require("./exec.js")
, uidNumber = require("./uid-number.js")
, umask = process.umask()
View
2  lib/utils/npm-registry-client/adduser.js
@@ -4,7 +4,7 @@ module.exports = adduser
var uuid = require("node-uuid")
, request = require("./request.js")
, log = require("../log.js")
- , npm = require("../../../npm.js")
+ , npm = require("../../npm.js")
, crypto
try {
View
2  lib/utils/npm-registry-client/get.js
@@ -3,7 +3,7 @@ module.exports = get
var GET = require("./request.js").GET
, fs = require("graceful-fs")
- , npm = require("../../../npm.js")
+ , npm = require("../../npm.js")
, path = require("path")
, log = require("../log.js")
, mkdir = require("../mkdir-p.js")
View
2  lib/utils/npm-registry-client/publish.js
@@ -9,7 +9,7 @@ var request = require("./request.js")
, upload = request.upload
, log = require("../log.js")
, path = require("path")
- , npm = require("../../../npm.js")
+ , npm = require("../../npm.js")
, url = require("url")
function publish (data, prebuilt, cb) {
View
2  lib/utils/npm-registry-client/request.js
@@ -5,7 +5,7 @@ regRequest.PUT = PUT
regRequest.reg = reg
regRequest.upload = upload
-var npm = require("../../../npm.js")
+var npm = require("../../npm.js")
, url = require("url")
, log = require("../log.js")
, fs = require("graceful-fs")
View
2  lib/utils/npm-registry-client/star.js
@@ -5,7 +5,7 @@ var request = require("./request.js")
, GET = request.GET
, PUT = request.PUT
, log = require("../log.js")
- , npm = require("../../../npm.js")
+ , npm = require("../../npm.js")
function star (package, starred, cb) {
var users = {}
View
2  lib/utils/output.js
@@ -4,7 +4,7 @@
exports.doColor = doColor
exports.write = write
-var npm = require("../../npm.js")
+var npm = require("../npm.js")
, tty = require("tty")
, streams = {}
, ttys = {}
View
2  lib/utils/read-installed.js
@@ -87,7 +87,7 @@ as far as the left-most node_modules folder.
*/
-var npm = require("../../npm.js")
+var npm = require("../npm.js")
, fs = require("graceful-fs")
, path = require("path")
, asyncMap = require("slide").asyncMap
View
2  lib/utils/read-json.js
@@ -9,7 +9,7 @@ var fs = require("graceful-fs")
, semver = require("semver")
, path = require("path")
, log = require("./log.js")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, cache = {}
, timers = {}
, loadPackageDefaults = require("./load-package-defaults.js")
View
2  lib/utils/tar.js
@@ -1,7 +1,7 @@
// commands for packing and unpacking tarballs
// this file is used by lib/cache.js
-var npm = require("../../npm.js")
+var npm = require("../npm.js")
, fs = require("graceful-fs")
, exec = require("./exec.js")
, spawn = exec.spawn
View
2  lib/utils/uid-number.js
@@ -9,7 +9,7 @@ var exec = require("./exec.js")
, path = require("path")
, log = require("./log.js")
, constants = require("constants")
- , npm = require("../../npm.js")
+ , npm = require("../npm.js")
, uidSupport = process.getuid && process.setuid
, uidCache = {}
, gidCache = {}
View
2  lib/version.js
@@ -9,7 +9,7 @@ var exec = require("./utils/exec.js")
, fs = require("graceful-fs")
, chain = require("slide").chain
, log = require("./utils/log.js")
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
version.usage = "npm version <newversion> [--message commit-message]"
+ "\n(run in package dir)\n"
View
2  lib/view.js
@@ -44,7 +44,7 @@ var registry = require("./utils/npm-registry-client/index.js")
, log = require("./utils/log.js")
, util = require("util")
, output
- , npm = require("../npm.js")
+ , npm = require("./npm.js")
, semver = require("semver")
, readJson = require("./utils/read-json.js")
View
2  lib/whoami.js
@@ -1,6 +1,6 @@
module.exports = whoami
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, output = require("./utils/output.js")
, log = require("./utils/log.js")
View
15 lib/xmas.js
@@ -1,12 +1,13 @@
// happy xmas
-var npm = require("../npm.js")
+var npm = require("./npm.js")
, log = require("./utils/log.js")
module.exports = function (args, cb) {
npm.config.set("loglevel", "win")
-var s = " \u2605"
+var s = process.platform === "win32" ? " *" : " \u2605"
, f = "\uFF0F"
, b = "\uFF3C"
+ , x = process.platform === "win32" ? " " : ""
, o = [ "\u0069" , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020"
, "\u0020", "\u0020", "\u0020", "\u0020", "\u0020", "\u0020"
, "\u0020", "\u2E1B","\u2042","\u2E2E","&","@","\uFF61" ]
@@ -18,27 +19,27 @@ function w (s) { process.stderr.write(s) }
w("\n")
;(function T (H) {
for (var i = 0; i < H; i ++) w(" ")
- w("\033[33m"+s+"\n")
+ w(x+"\033[33m"+s+"\n")
var M = H * 2 - 1
for (L = 1; L <= H; L ++) {
var O = L * 2 - 2
var S = (M - O) / 2
for (var i = 0; i < S; i ++) w(" ")
- w("\033[32m"+f)
+ w(x+"\033[32m"+f)
for (var i = 0; i < O; i ++) w(
"\033["+oc[Math.floor(Math.random()*oc.length)]+"m"+
o[Math.floor(Math.random() * o.length)]
)
- w("\033[32m"+b+"\n")
+ w(x+"\033[32m"+b+"\n")
}
w(" ")
for (var i = 1; i < H; i ++) w("\033[32m"+l)
- w("| |")
+ w("| "+x+" |")
for (var i = 1; i < H; i ++) w("\033[32m"+l)
if (H > 10) {
w("\n ")
for (var i = 1; i < H; i ++) w(" ")
- w("| |")
+ w("| "+x+" |")
for (var i = 1; i < H; i ++) w(" ")
}
})(20)
View
8 package.json
@@ -19,10 +19,10 @@
, "lib" : "./lib"
, "bin" : "./bin"
}
-, "main" : "npm"
-, "bin" : { "npm" : "./bin/npm.js"
- , "npm_g" : "./bin/npm.js"
- , "npm-g" : "./bin/npm.js" }
+, "main" : "./lib/npm.js"
+, "bin" : { "npm" : "./bin/npm-cli.js"
+ , "npm_g" : "./bin/npm-cli.js"
+ , "npm-g" : "./bin/npm-cli.js" }
, "dependencies" :
{ "semver" : "1"
, "ini" : "1"
Please sign in to comment.
Something went wrong with that request. Please try again.