diff --git a/deps/npm/.npmignore b/deps/npm/.npmignore index 94dc33f004..b1d9066bde 100644 --- a/deps/npm/.npmignore +++ b/deps/npm/.npmignore @@ -1,16 +1,16 @@ *.swp -test/bin -test/output.log -test/packages/*/node_modules -test/packages/npm-test-depends-on-spark/which-spark.log -test/packages/test-package/random-data.txt -test/root -node_modules/ronn -node_modules/.bin npm-debug.log -./npmrc -.gitignore -release/ +/test/bin +/test/output.log +/test/packages/*/node_modules +/test/packages/npm-test-depends-on-spark/which-spark.log +/test/packages/test-package/random-data.txt +/test/root +/node_modules/ronn +/node_modules/tap +/node_modules/.bin +/npmrc +/release/ # don't need these in the npm package. html/*.png diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index fcfa7f2b08..b2adf342ab 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -66,3 +66,8 @@ Joost-Wim Boekesteijn Dalmais Maxence Marcus Ekwall Aaron Stacy +Phillip Howell +Domenic Denicola +James Halliday +Jeremy Cantrell +Ribettes diff --git a/deps/npm/LICENSE b/deps/npm/LICENSE index c94425929d..3702d8a05b 100644 --- a/deps/npm/LICENSE +++ b/deps/npm/LICENSE @@ -49,6 +49,11 @@ and are not covered by this license. "npm Logo" created by Mathias Pettersson and Brian Hammond, used with permission. +"Gubblebum Blocky" font +Copyright (c) 2007 by Tjarda Koster, http://jelloween.deviantart.com +included for use in the npm website and documentation, +used with permission. + This program uses "node-uuid", Copyright (c) 2010 Robert Kieffer, according to the terms of the MIT license. diff --git a/deps/npm/README.md b/deps/npm/README.md index d5e285ab0e..1257f14716 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -89,21 +89,15 @@ To install the latest **unstable** development version from git: git clone https://github.com/isaacs/npm.git cd npm - git submodule update --init --recursive sudo make install # (or: `node cli.js install -gf`) If you're sitting in the code folder reading this document in your terminal, then you've already got the code. Just do: - git submodule update --init --recursive sudo make install and npm will install itself. -Note that github tarballs **do not contain submodules**, so -those won't work. You'll have to also fetch the appropriate submodules -listed in the .gitmodules file. - ## Permissions when Using npm to Install Other Stuff **tl;dr** diff --git a/deps/npm/bin/npm b/deps/npm/bin/npm index 5fbcd3b035..07ade35e08 100755 --- a/deps/npm/bin/npm +++ b/deps/npm/bin/npm @@ -1,6 +1,13 @@ #!/bin/sh -if [ -x "`dirname "$0"`/node.exe" ]; then - "`dirname "$0"`/node.exe" "`dirname "$0"`/node_modules/npm/bin/npm-cli.js" "$@" + +basedir=`dirname "$0"` + +case `uname` in + *CYGWIN*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node.exe" ]; then + "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@" else - node "`dirname "$0"`/node_modules/npm/bin/npm-cli.js" "$@" + node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" fi diff --git a/deps/npm/bin/npm-cli.js b/deps/npm/bin/npm-cli.js index f29437093e..a71985b37b 100755 --- a/deps/npm/bin/npm-cli.js +++ b/deps/npm/bin/npm-cli.js @@ -15,9 +15,9 @@ if (typeof WScript !== "undefined") { process.title = "npm" -var log = require("../lib/utils/log.js") -log.waitForConfig() -log.info("ok", "it worked if it ends with") +var log = require("npmlog") +log.pause() // will be unpaused when config is loaded. +log.info("it worked if it ends with", "ok") var fs = require("graceful-fs") , path = require("path") @@ -36,7 +36,7 @@ if (path.basename(process.argv[1]).slice(-1) === "g") { process.argv.splice(1, 1, "npm", "-g") } -log.verbose(process.argv, "cli") +log.verbose("cli", process.argv) var conf = nopt(types, shorthands) npm.argv = conf.argv.remain @@ -56,8 +56,8 @@ if (conf.versions) { return } -log.info("npm@"+npm.version, "using") -log.info("node@"+process.version, "using") +log.info("using", "npm@%s", npm.version) +log.info("using", "node@%s", process.version) // make sure that this version of node works with this version of npm. var semver = require("semver") diff --git a/deps/npm/bin/read-package-json.js b/deps/npm/bin/read-package-json.js index 8c95d86e8b..3e5a0c77f2 100755 --- a/deps/npm/bin/read-package-json.js +++ b/deps/npm/bin/read-package-json.js @@ -6,7 +6,7 @@ if (argv.length < 3) { var fs = require("fs") , file = argv[2] - , readJson = require("../lib/utils/read-json") + , readJson = require("read-package-json") readJson(file, function (er, data) { if (er) throw er diff --git a/deps/npm/doc/cli/coding-style.md b/deps/npm/doc/cli/coding-style.md index 42ac1d785f..c505dba83f 100644 --- a/deps/npm/doc/cli/coding-style.md +++ b/deps/npm/doc/cli/coding-style.md @@ -129,29 +129,18 @@ Just send the error message back as the first argument to the callback. Always create a new Error object with your message. Don't just return a string message to the callback. Stack traces are handy. -Use the `require("./utils/log").er` function. It takes a callback and an -error message, and returns an object that will report the message in the -event of a failure. It's quite handy. - - function myThing (args, cb) { - getData(args, function (er, data) { - if (er) return log.er(cb, "Couldn't get data")(er) - doSomethingElse(data, cb) - }) - } - function justHasToWork (cb) { - doSomething(log.er(cb, "the doSomething failed.")) - } - ## Logging +Logging is done using the [npmlog](https://github.com/isaacs/npmlog) +utility. + Please clean up logs when they are no longer helpful. In particular, logging the same object over and over again is not helpful. Logs should report what's happening so that it's easier to track down where a fault occurs. -Use appropriate log levels. The default log() function logs at the -"info" level. See `npm-config(1)` and search for "loglevel". +Use appropriate log levels. See `npm-config(1)` and search for +"loglevel". ## Case, naming, etc. diff --git a/deps/npm/doc/cli/config.md b/deps/npm/doc/cli/config.md index 3fd9cb8269..537af5ca0e 100644 --- a/deps/npm/doc/cli/config.md +++ b/deps/npm/doc/cli/config.md @@ -117,6 +117,7 @@ The following shorthands are parsed on the command-line: * `-S`: `--save` * `-D`: `--save-dev` * `-O`: `--save-optional` +* `-B`: `--save-bundle` * `-y`: `--yes` * `-n`: `--yes false` * `ll` and `la` commands: `ls --long` @@ -167,32 +168,6 @@ then the user could change the behavior by doing: Force npm to always require authentication when accessing the registry, even for `GET` requests. -### bin-publish - -* Default: false -* Type: Boolean - -If set to true, then binary packages will be created on publish. - -This is the way to opt into the "bindist" behavior described below. - -### bindist - -* Default: Unstable node versions, `null`, otherwise - `"--"` -* Type: String or `null` - -Experimental: on stable versions of node, binary distributions will be -created with this tag. If a user then installs that package, and their -`bindist` tag is found in the list of binary distributions, they will -get that prebuilt version. - -Pre-build node packages have their preinstall, install, and postinstall -scripts stripped (since they are run prior to publishing), and do not -have their `build` directories automatically ignored. - -It's yet to be seen if this is a good idea. - ### browser * Default: OS X: `"open"`, others: `"google-chrome"` @@ -220,6 +195,27 @@ See also the `strict-ssl` config. The location of npm's cache directory. See `npm-cache(1)` +### cache-lock-stale + +* Default: 60000 (1 minute) +* Type: Number + +The number of ms before cache folder lockfiles are considered stale. + +### cache-lock-retries + +* Default: 10 +* Type: Number + +Number of times to retry to acquire a lock on cache folder lockfiles. + +### cache-lock-wait + +* Default: 10000 (10 seconds) +* Type: Number + +Number of ms to wait for cache lock files to expire. + ### cache-max * Default: Infinity @@ -291,6 +287,15 @@ set. The command to run for `npm edit` or `npm config edit`. +### engine-strict + +* Default: false +* Type: Boolean + +If set to true, then npm will stubbornly refuse to install (or even +consider installing) any package that claims to not be compatible with +the current Node.js version. + ### force * Default: false @@ -303,6 +308,38 @@ Makes various commands more forceful. * skips cache when requesting from the registry. * prevents checks against clobbering non-npm files. +### fetch-retries + +* Default: 2 +* Type: Number + +The "retries" config for the `retry` module to use when fetching +packages from the registry. + +### fetch-retry-factor + +* Default: 10 +* Type: Number + +The "factor" config for the `retry` module to use when fetching +packages. + +### fetch-retry-mintimeout + +* Default: 10000 (10 seconds) +* Type: Number + +The "minTimeout" config for the `retry` module to use when fetching +packages. + +### fetch-retry-maxtimeout + +* Default: 60000 (1 minute) +* Type: Number + +The "maxTimeout" config for the `retry` module to use when fetching +packages. + ### git * Default: `"git"` @@ -375,6 +412,16 @@ Sets a User-Agent to the request header A white-space separated list of glob patterns of files to always exclude from packages when building tarballs. +### init-module + +* Default: ~/.npm-init.js +* Type: path + +A module that will be loaded by the `npm init` command. See the +documentation for the +[init-package-json](https://github.com/isaacs/init-package-json) module +for more information, or npm-init(1). + ### init.version * Default: "0.0.0" @@ -430,13 +477,6 @@ if one of the two conditions are met: * the globally installed version is identical to the version that is being installed locally. -### logfd - -* Default: stderr file descriptor -* Type: Number or Stream - -The location to write log output. - ### loglevel * Default: "http" @@ -449,13 +489,17 @@ What level of logs to report. On failure, *all* logs are written to Any logs of a higher level than the setting are shown. The default is "http", which shows http, warn, and error output. -### logprefix +### logstream -* Default: true on Posix, false on Windows -* Type: Boolean +* Default: process.stderr +* Type: Stream + +This is the stream that is passed to the +[npmlog](https://github.com/isaacs/npmlog) module at run time. -Whether or not to prefix log messages with "npm" and the log level. See -also "color" and "loglevel". +It cannot be set from the command line, but if you are using npm +programmatically, you may wish to send logs to somewhere other than +stderr. ### long @@ -503,13 +547,6 @@ The url to report npat test results. A node module to `require()` when npm loads. Useful for programmatic usage. -### outfd - -* Default: standard output file descriptor -* Type: Number or Stream - -Where to write "normal" output. This has no effect on log output. - ### parseable * Default: false @@ -584,8 +621,23 @@ Remove failed installs. Save installed packages to a package.json file as dependencies. +When used with the `npm rm` command, it removes it from the dependencies +hash. + Only works if there is already a package.json file present. +### save-bundle + +* Default: false +* Type: Boolean + +If a package would be saved at install time by the use of `--save`, +`--save-dev`, or `--save-optional`, then also put it in the +`bundleDependencies` list. + +When used with the `npm rm` command, it removes it from the +bundledDependencies list. + ### save-dev * Default: false @@ -593,6 +645,9 @@ Only works if there is already a package.json file present. Save installed packages to a package.json file as devDependencies. +When used with the `npm rm` command, it removes it from the devDependencies +hash. + Only works if there is already a package.json file present. ### save-optional @@ -602,6 +657,9 @@ Only works if there is already a package.json file present. Save installed packages to a package.json file as optionalDependencies. +When used with the `npm rm` command, it removes it from the devDependencies +hash. + Only works if there is already a package.json file present. ### searchopts diff --git a/deps/npm/doc/cli/init.md b/deps/npm/doc/cli/init.md index 39297b4c4d..d036f924db 100644 --- a/deps/npm/doc/cli/init.md +++ b/deps/npm/doc/cli/init.md @@ -20,5 +20,6 @@ without a really good reason to do so. ## SEE ALSO +* * npm-json(1) * npm-version(1) diff --git a/deps/npm/doc/cli/install.md b/deps/npm/doc/cli/install.md index cfa95e7229..1d2f6eca8f 100644 --- a/deps/npm/doc/cli/install.md +++ b/deps/npm/doc/cli/install.md @@ -160,7 +160,7 @@ local copy exists on disk. npm install sax --force The `--global` argument will cause npm to install the package globally -rather than locally. See `npm-global(1)`. +rather than locally. See `npm-folders(1)`. The `--link` argument will cause npm to link global installs into the local space in some cases. diff --git a/deps/npm/doc/cli/json.md b/deps/npm/doc/cli/json.md index 5f50cd2cfa..b6bf89ca37 100644 --- a/deps/npm/doc/cli/json.md +++ b/deps/npm/doc/cli/json.md @@ -453,8 +453,7 @@ Entries in `optionalDependencies` will override entries of the same name in ## engines -You can specify the version of -node that your stuff works on: +You can specify the version of node that your stuff works on: { "engines" : { "node" : ">=0.1.27 <0.1.30" } } @@ -470,6 +469,22 @@ are capable of properly installing your program. For example: { "engines" : { "npm" : "~1.0.20" } } +Note that, unless the user has set the `engine-strict` config flag, this +field is advisory only. + +## engineStrict + +If you are sure that your module will *definitely not* run properly on +versions of Node/npm other than those specified in the `engines` hash, +then you can set `"engineStrict": true` in your package.json file. +This will override the user's `engine-strict` config setting. + +Please do not do this unless you are really very very sure. If your +engines hash is something overly restrictive, you can quite easily and +inadvertently lock yourself into obscurity and prevent your users from +updating to new versions of Node. Consider this choice carefully. If +people abuse it, it will be removed in a future version of npm. + ## os You can specify which operating systems your diff --git a/deps/npm/doc/cli/list.md b/deps/npm/doc/cli/list.md index 93d86cd838..3dd709b62b 100644 --- a/deps/npm/doc/cli/list.md +++ b/deps/npm/doc/cli/list.md @@ -3,20 +3,26 @@ npm-ls(1) -- List installed packages ## SYNOPSIS - npm list - npm ls - npm la - npm ll + npm list [ ...] + npm ls [ ...] + npm la [ ...] + npm ll [ ...] ## DESCRIPTION This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure. -It does not take positional arguments, though you may set config flags -like with any other command, such as `-g` to list global packages. +Positional arguments are `name@version-range` identifiers, which will +limit the results to only the paths to the packages named. Note that +nested packages will *also* show the paths to the specified packages. +For example, running `npm ls promzard` in npm's source tree will show: -It will print out extraneous, missing, and invalid packages. + npm@@VERSION@ /path/to/npm + └─┬ init-package-json@0.0.4 + └── promzard@0.1.5 + +It will show print out extraneous, missing, and invalid packages. When run as `ll` or `la`, it shows extended information by default. diff --git a/deps/npm/html/api/bin.html b/deps/npm/html/api/bin.html index f6781bfa4f..4d328da3ff 100644 --- a/deps/npm/html/api/bin.html +++ b/deps/npm/html/api/bin.html @@ -19,7 +19,7 @@

This function should not be used programmatically. Instead, just refer to the npm.bin member.

- +