Skip to content

Commit

Permalink
npm: Upgrade to v1.2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 6, 2013
1 parent a86ebbe commit 5aef65a
Show file tree
Hide file tree
Showing 270 changed files with 2,139 additions and 749 deletions.
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,5 @@ Ian Livingstone <ianl@cs.dal.ca>
Patrick Pfeiffer <patrick@buzzle.at>
Paul Miller <paul@paulmillr.com>
seebees <seebees@gmail.com>
Carl Lange <carl@flax.ie>
Jan Lehnardt <jan@apache.org>
15 changes: 8 additions & 7 deletions deps/npm/doc/api/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ npm(3) -- node package manager
## SYNOPSIS

var npm = require("npm")
npm.load(configObject, function (er, npm) {
npm.load([configObject,] function (er, npm) {
// use the npm object, now that it's loaded.

npm.config.set(key, val)
Expand All @@ -25,12 +25,13 @@ This is the API documentation for npm.
To find documentation of the command line
client, see `npm(1)`.

Prior to using npm's commands,
`npm.load()` must be called with an object hash of
top-level configs. In the npm command line client,
this set of configs is parsed from the command line options. Additional
configuration params are loaded from two configuration files. See
`npm-config(1)` for more information.
Prior to using npm's commands, `npm.load()` must be called.
If you provide `configObject` as an object hash of top-level
configs, they override the values stored in the various config
locations. In the npm command line client, this set of configs
is parsed from the command line options. Additional configuration
params are loaded from two configuration files. See `npm-config(1)`
for more information.

After that, each of the functions are accessible in the
commands object: `npm.commands.<cmd>`. See `npm-index(1)` for a list of
Expand Down
24 changes: 18 additions & 6 deletions deps/npm/doc/cli/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@ then the user could change the behavior by doing:
Force npm to always require authentication when accessing the registry,
even for `GET` requests.

### bin-links

* Default: `true`
* Type: Boolean

Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.

Set to false to have it not do this. This can be used to work around
the fact that some file systems don't support symlinks, even on
ostensibly Unix systems.

### browser

* Default: OS X: `"open"`, others: `"google-chrome"`
Expand Down Expand Up @@ -228,7 +240,7 @@ explicitly used, and that only GET requests use the cache.

### cache-min

* Default: 0
* Default: 10
* Type: Number

The minimum time (in seconds) to keep items in the registry cache before
Expand Down Expand Up @@ -357,10 +369,10 @@ Operates in "global" mode, so that packages are installed into the
`prefix` folder instead of the current working directory. See
`npm-folders(1)` for more on the differences in behavior.

* packages are installed into the `prefix/node_modules` folder, instead of the
* packages are installed into the `{prefix}/lib/node_modules` folder, instead of the
current working directory.
* bin files are linked to `prefix/bin`
* man pages are linked to `prefix/share/man`
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`

### globalconfig

Expand Down Expand Up @@ -398,7 +410,7 @@ A proxy to use for outgoing https requests.

### user-agent

* Default: npm/{npm.version} node/{process.version}
* Default: node/{process.version} {process.platform} {process.arch}
* Type: String

Sets a User-Agent to the request header
Expand Down Expand Up @@ -568,7 +580,7 @@ standard output.

### prefix

* Default: node's process.installPrefix
* Default: see npm-folders(1)
* Type: path

The location to install global items. If set on the command line, then
Expand Down
209 changes: 209 additions & 0 deletions deps/npm/doc/cli/global.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
npm-folders(1) -- Folder Structures Used by npm
===============================================

## DESCRIPTION

npm puts various things on your computer. That's its job.

This document will tell you what it puts where.

### tl;dr

* Local install (default): puts stuff in `./node_modules` of the current
package root.
* Global install (with `-g`): puts stuff in /usr/local or wherever node
is installed.
* Install it **locally** if you're going to `require()` it.
* Install it **globally** if you're going to run it on the command line.
* If you need both, then install it in both places, or use `npm link`.

### prefix Configuration

The `prefix` config defaults to the location where node is installed.
On most systems, this is `/usr/local`, and most of the time is the same
as node's `process.installPrefix`.

On windows, this is the exact location of the node.exe binary. On Unix
systems, it's one level up, since node is typically installed at
`{prefix}/bin/node` rather than `{prefix}/node.exe`.

When the `global` flag is set, npm installs things into this prefix.
When it is not set, it uses the root of the current package, or the
current working directory if not in a package already.

### Node Modules

Packages are dropped into the `node_modules` folder under the `prefix`.
When installing locally, this means that you can
`require("packagename")` to load its main module, or
`require("packagename/lib/path/to/sub/module")` to load other modules.

Global installs on Unix systems go to `{prefix}/lib/node_modules`.
Global installs on Windows go to `{prefix}/node_modules` (that is, no
`lib` folder.)

If you wish to `require()` a package, then install it locally.

### Executables

When in global mode, executables are linked into `{prefix}/bin` on Unix,
or directly into `{prefix}` on Windows.

When in local mode, executables are linked into
`./node_modules/.bin` so that they can be made available to scripts run
through npm. (For example, so that a test runner will be in the path
when you run `npm test`.)

### Man Pages

When in global mode, man pages are linked into `{prefix}/share/man`.

When in local mode, man pages are not installed.

Man pages are not installed on Windows systems.

### Cache

See `npm-cache(1)`. Cache files are stored in `~/.npm` on Posix, or
`~/npm-cache` on Windows.

This is controlled by the `cache` configuration param.

### Temp Files

Temporary files are stored by default in the folder specified by the
`tmp` config, which defaults to the TMPDIR, TMP, or TEMP environment
variables, or `/tmp` on Unix and `c:\windows\temp` on Windows.

Temp files are given a unique folder under this root for each run of the
program, and are deleted upon successful exit.

## More Information

When installing locally, npm first tries to find an appropriate
`prefix` folder. This is so that `npm install foo@1.2.3` will install
to the sensible root of your package, even if you happen to have `cd`ed
into some other folder.

Starting at the $PWD, npm will walk up the folder tree checking for a
folder that contains either a `package.json` file, or a `node_modules`
folder. If such a thing is found, then that is treated as the effective
"current directory" for the purpose of running npm commands. (This
behavior is inspired by and similar to git's .git-folder seeking
logic when running git commands in a working dir.)

If no package root is found, then the current folder is used.

When you run `npm install foo@1.2.3`, then the package is loaded into
the cache, and then unpacked into `./node_modules/foo`. Then, any of
foo's dependencies are similarly unpacked into
`./node_modules/foo/node_modules/...`.

Any bin files are symlinked to `./node_modules/.bin/`, so that they may
be found by npm scripts when necessary.

### Global Installation

If the `global` configuration is set to true, then npm will
install packages "globally".

For global installation, packages are installed roughly the same way,
but using the folders described above.

### Cycles, Conflicts, and Folder Parsimony

Cycles are handled using the property of node's module system that it
walks up the directories looking for `node_modules` folders. So, at every
stage, if a package is already installed in an ancestor `node_modules`
folder, then it is not installed at the current location.

Consider the case above, where `foo -> bar -> baz`. Imagine if, in
addition to that, baz depended on bar, so you'd have:
`foo -> bar -> baz -> bar -> baz ...`. However, since the folder
structure is: `foo/node_modules/bar/node_modules/baz`, there's no need to
put another copy of bar into `.../baz/node_modules`, since when it calls
require("bar"), it will get the copy that is installed in
`foo/node_modules/bar`.

This shortcut is only used if the exact same
version would be installed in multiple nested `node_modules` folders. It
is still possible to have `a/node_modules/b/node_modules/a` if the two
"a" packages are different versions. However, without repeating the
exact same package multiple times, an infinite regress will always be
prevented.

Another optimization can be made by installing dependencies at the
highest level possible, below the localized "target" folder.

#### Example

Consider this dependency graph:

foo
+-- blerg@1.2.5
+-- bar@1.2.3
| +-- blerg@1.x (latest=1.3.7)
| +-- baz@2.x
| | `-- quux@3.x
| | `-- bar@1.2.3 (cycle)
| `-- asdf@*
`-- baz@1.2.3
`-- quux@3.x
`-- bar

In this case, we might expect a folder structure like this:

foo
+-- node_modules
+-- blerg (1.2.5) <---[A]
+-- bar (1.2.3) <---[B]
| +-- node_modules
| | `-- baz (2.0.2) <---[C]
| | `-- node_modules
| | `-- quux (3.2.0)
| `-- asdf (2.3.4)
`-- baz (1.2.3) <---[D]
`-- node_modules
`-- quux (3.2.0) <---[E]

Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are
installed in foo's `node_modules` folder.

Even though the latest copy of blerg is 1.3.7, foo has a specific
dependency on version 1.2.5. So, that gets installed at [A]. Since the
parent installation of blerg satisfie's bar's dependency on blerg@1.x,
it does not install another copy under [B].

Bar [B] also has dependencies on baz and asdf, so those are installed in
bar's `node_modules` folder. Because it depends on `baz@2.x`, it cannot
re-use the `baz@1.2.3` installed in the parent `node_modules` folder [D],
and must install its own copy [C].

Underneath bar, the `baz->quux->bar` dependency creates a cycle.
However, because `bar` is already in `quux`'s ancestry [B], it does not
unpack another copy of bar into that folder.

Underneath `foo->baz` [D], quux's [E] folder tree is empty, because its
dependency on bar is satisfied by the parent folder copy installed at [B].

For a graphical breakdown of what is installed where, use `npm ls`.

### Publishing

Upon publishing, npm will look in the `node_modules` folder. If any of
the items there are not in the `bundledDependencies` array, then they will
not be included in the package tarball.

This allows a package maintainer to install all of their dependencies
(and dev dependencies) locally, but only re-publish those items that
cannot be found elsewhere. See `npm-json(1)` for more information.

## SEE ALSO

* npm-faq(1)
* npm-json(1)
* npm-install(1)
* npm-pack(1)
* npm-cache(1)
* npm-config(1)
* npm-publish(1)
8 changes: 8 additions & 0 deletions deps/npm/doc/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ npm-index(1) -- Index of all npm documentation

Folder Structures Used by npm

## npm-global(1)

Folder Structures Used by npm

## npm-help-search(1)

Search npm help documentation
Expand Down Expand Up @@ -154,6 +158,10 @@ npm-index(1) -- Index of all npm documentation

Start a package

## npm-rm(1)

Remove a package

## npm-root(1)

Display npm root
Expand Down
3 changes: 3 additions & 0 deletions deps/npm/doc/cli/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ rather than locally. See `npm-folders(1)`.
The `--link` argument will cause npm to link global installs into the
local space in some cases.

The `--no-bin-links` argument will prevent npm from creating symlinks for
any binaries the package might contain.

See `npm-config(1)`. Many of the configuration params have some
effect on installation, since that's most of what npm does.

Expand Down
19 changes: 19 additions & 0 deletions deps/npm/doc/cli/rm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
npm-rm(1) -- Remove a package
=============================

## SYNOPSIS

npm rm <name>
npm uninstall <name>

## DESCRIPTION

This uninstalls a package, completely removing everything npm installed
on its behalf.

## SEE ALSO

* npm-prune(1)
* npm-install(1)
* npm-folders(1)
* npm-config(1)
2 changes: 1 addition & 1 deletion deps/npm/html/api/bin.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>This function should not be used programmatically. Instead, just refer
to the <code>npm.bin</code> member.</p>
</div>
<p id="footer">bin &mdash; npm@1.2.2</p>
<p id="footer">bin &mdash; npm@1.2.10</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/bugs.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
<p id="footer">bugs &mdash; npm@1.2.2</p>
<p id="footer">bugs &mdash; npm@1.2.10</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/commands.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2>

<ul><li><a href="../doc/index.html">index(1)</a></li></ul>
</div>
<p id="footer">commands &mdash; npm@1.2.2</p>
<p id="footer">commands &mdash; npm@1.2.10</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2>

<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
<p id="footer">config &mdash; npm@1.2.2</p>
<p id="footer">config &mdash; npm@1.2.10</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
Loading

0 comments on commit 5aef65a

Please sign in to comment.