Revision 5aef65a9

View differences:

deps/npm/AUTHORS
88 88
Patrick Pfeiffer <patrick@buzzle.at>
89 89
Paul Miller <paul@paulmillr.com>
90 90
seebees <seebees@gmail.com>
91
Carl Lange <carl@flax.ie>
92
Jan Lehnardt <jan@apache.org>
deps/npm/doc/api/npm.md
4 4
## SYNOPSIS
5 5

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

  
10 10
      npm.config.set(key, val)
......
25 25
To find documentation of the command line
26 26
client, see `npm(1)`.
27 27

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

  
35 36
After that, each of the functions are accessible in the
36 37
commands object: `npm.commands.<cmd>`.  See `npm-index(1)` for a list of
deps/npm/doc/cli/config.md
167 167
Force npm to always require authentication when accessing the registry,
168 168
even for `GET` requests.
169 169

  
170
### bin-links
171

  
172
* Default: `true`
173
* Type: Boolean
174

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

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

  
170 182
### browser
171 183

  
172 184
* Default: OS X: `"open"`, others: `"google-chrome"`
......
228 240

  
229 241
### cache-min
230 242

  
231
* Default: 0
243
* Default: 10
232 244
* Type: Number
233 245

  
234 246
The minimum time (in seconds) to keep items in the registry cache before
......
357 369
`prefix` folder instead of the current working directory.  See
358 370
`npm-folders(1)` for more on the differences in behavior.
359 371

  
360
* packages are installed into the `prefix/node_modules` folder, instead of the
372
* packages are installed into the `{prefix}/lib/node_modules` folder, instead of the
361 373
  current working directory.
362
* bin files are linked to `prefix/bin`
363
* man pages are linked to `prefix/share/man`
374
* bin files are linked to `{prefix}/bin`
375
* man pages are linked to `{prefix}/share/man`
364 376

  
365 377
### globalconfig
366 378

  
......
398 410

  
399 411
### user-agent
400 412

  
401
* Default: npm/{npm.version} node/{process.version}
413
* Default: node/{process.version} {process.platform} {process.arch}
402 414
* Type: String
403 415

  
404 416
Sets a User-Agent to the request header
......
568 580

  
569 581
### prefix
570 582

  
571
* Default: node's process.installPrefix
583
* Default: see npm-folders(1)
572 584
* Type: path
573 585

  
574 586
The location to install global items.  If set on the command line, then
deps/npm/doc/cli/global.md
1
npm-folders(1) -- Folder Structures Used by npm
2
===============================================
3

  
4
## DESCRIPTION
5

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

  
8
This document will tell you what it puts where.
9

  
10
### tl;dr
11

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

  
20
### prefix Configuration
21

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

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

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

  
34
### Node Modules
35

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

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

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

  
47
### Executables
48

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

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

  
57
### Man Pages
58

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

  
61
When in local mode, man pages are not installed.
62

  
63
Man pages are not installed on Windows systems.
64

  
65
### Cache
66

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

  
70
This is controlled by the `cache` configuration param.
71

  
72
### Temp Files
73

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

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

  
81
## More Information
82

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

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

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

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

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

  
105
### Global Installation
106

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

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

  
113
### Cycles, Conflicts, and Folder Parsimony
114

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

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

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

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

  
138
#### Example
139

  
140
Consider this dependency graph:
141

  
142
    foo
143
    +-- blerg@1.2.5
144
    +-- bar@1.2.3
145
    |   +-- blerg@1.x (latest=1.3.7)
146
    |   +-- baz@2.x
147
    |   |   `-- quux@3.x
148
    |   |       `-- bar@1.2.3 (cycle)
149
    |   `-- asdf@*
150
    `-- baz@1.2.3
151
        `-- quux@3.x
152
            `-- bar
153

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

  
156
    foo
157
    +-- node_modules
158
        +-- blerg (1.2.5) <---[A]
159
        +-- bar (1.2.3) <---[B]
160
        |   +-- node_modules
161
        |   |   `-- baz (2.0.2) <---[C]
162
        |   |       `-- node_modules
163
        |   |           `-- quux (3.2.0)
164
        |   `-- asdf (2.3.4)
165
        `-- baz (1.2.3) <---[D]
166
            `-- node_modules
167
                `-- quux (3.2.0) <---[E]
168

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

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

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

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

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

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

  
191
### Publishing
192

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

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

  
201
## SEE ALSO
202

  
203
* npm-faq(1)
204
* npm-json(1)
205
* npm-install(1)
206
* npm-pack(1)
207
* npm-cache(1)
208
* npm-config(1)
209
* npm-publish(1)
deps/npm/doc/cli/index.md
82 82

  
83 83
 Folder Structures Used by npm
84 84

  
85
## npm-global(1)
86

  
87
 Folder Structures Used by npm
88

  
85 89
## npm-help-search(1)
86 90

  
87 91
 Search npm help documentation
......
154 158

  
155 159
 Start a package
156 160

  
161
## npm-rm(1)
162

  
163
 Remove a package
164

  
157 165
## npm-root(1)
158 166

  
159 167
 Display npm root
deps/npm/doc/cli/install.md
165 165
The `--link` argument will cause npm to link global installs into the
166 166
local space in some cases.
167 167

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

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

  
deps/npm/doc/cli/rm.md
1
npm-rm(1) -- Remove a package
2
=============================
3

  
4
## SYNOPSIS
5

  
6
    npm rm <name>
7
    npm uninstall <name>
8

  
9
## DESCRIPTION
10

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

  
14
## SEE ALSO
15

  
16
* npm-prune(1)
17
* npm-install(1)
18
* npm-folders(1)
19
* npm-config(1)
deps/npm/html/api/bin.html
19 19
<p>This function should not be used programmatically.  Instead, just refer
20 20
to the <code>npm.bin</code> member.</p>
21 21
</div>
22
<p id="footer">bin &mdash; npm@1.2.2</p>
22
<p id="footer">bin &mdash; npm@1.2.10</p>
23 23
<script>
24 24
;(function () {
25 25
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/bugs.html
25 25
<p>This command will launch a browser, so this command may not be the most
26 26
friendly for programmatic use.</p>
27 27
</div>
28
<p id="footer">bugs &mdash; npm@1.2.2</p>
28
<p id="footer">bugs &mdash; npm@1.2.10</p>
29 29
<script>
30 30
;(function () {
31 31
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/commands.html
28 28

  
29 29
<ul><li><a href="../doc/index.html">index(1)</a></li></ul>
30 30
</div>
31
<p id="footer">commands &mdash; npm@1.2.2</p>
31
<p id="footer">commands &mdash; npm@1.2.10</p>
32 32
<script>
33 33
;(function () {
34 34
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/config.html
33 33

  
34 34
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
35 35
</div>
36
<p id="footer">config &mdash; npm@1.2.2</p>
36
<p id="footer">config &mdash; npm@1.2.10</p>
37 37
<script>
38 38
;(function () {
39 39
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/deprecate.html
32 32

  
33 33
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../api/unpublish.html">unpublish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
34 34
</div>
35
<p id="footer">deprecate &mdash; npm@1.2.2</p>
35
<p id="footer">deprecate &mdash; npm@1.2.10</p>
36 36
<script>
37 37
;(function () {
38 38
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/docs.html
25 25
<p>This command will launch a browser, so this command may not be the most
26 26
friendly for programmatic use.</p>
27 27
</div>
28
<p id="footer">docs &mdash; npm@1.2.2</p>
28
<p id="footer">docs &mdash; npm@1.2.10</p>
29 29
<script>
30 30
;(function () {
31 31
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/edit.html
30 30
<p>Since this command opens an editor in a new process, be careful about where
31 31
and how this is used.</p>
32 32
</div>
33
<p id="footer">edit &mdash; npm@1.2.2</p>
33
<p id="footer">edit &mdash; npm@1.2.10</p>
34 34
<script>
35 35
;(function () {
36 36
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/explore.html
24 24

  
25 25
<p>The first element in the &#39;args&#39; parameter must be a package name.  After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.</p>
26 26
</div>
27
<p id="footer">explore &mdash; npm@1.2.2</p>
27
<p id="footer">explore &mdash; npm@1.2.10</p>
28 28
<script>
29 29
;(function () {
30 30
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/help-search.html
32 32

  
33 33
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
34 34
</div>
35
<p id="footer">help-search &mdash; npm@1.2.2</p>
35
<p id="footer">help-search &mdash; npm@1.2.10</p>
36 36
<script>
37 37
;(function () {
38 38
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/init.html
35 35

  
36 36
<p><a href="../doc/json.html">json(1)</a></p>
37 37
</div>
38
<p id="footer">init &mdash; npm@1.2.2</p>
38
<p id="footer">init &mdash; npm@1.2.10</p>
39 39
<script>
40 40
;(function () {
41 41
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/install.html
25 25
<p>Finally, &#39;callback&#39; is a function that will be called when all packages have been
26 26
installed or when an error has been encountered.</p>
27 27
</div>
28
<p id="footer">install &mdash; npm@1.2.2</p>
28
<p id="footer">install &mdash; npm@1.2.10</p>
29 29
<script>
30 30
;(function () {
31 31
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/link.html
39 39
<p>Now, any changes to the redis package will be reflected in
40 40
the package in the current working directory</p>
41 41
</div>
42
<p id="footer">link &mdash; npm@1.2.2</p>
42
<p id="footer">link &mdash; npm@1.2.10</p>
43 43
<script>
44 44
;(function () {
45 45
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/load.html
32 32

  
33 33
<p>For a list of all the available command-line configs, see <code>npm help config</code></p>
34 34
</div>
35
<p id="footer">load &mdash; npm@1.2.2</p>
35
<p id="footer">load &mdash; npm@1.2.10</p>
36 36
<script>
37 37
;(function () {
38 38
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/ls.html
59 59
This means that if a submodule a same dependency as a parent module, then the
60 60
dependency will only be output once.</p>
61 61
</div>
62
<p id="footer">ls &mdash; npm@1.2.2</p>
62
<p id="footer">ls &mdash; npm@1.2.10</p>
63 63
<script>
64 64
;(function () {
65 65
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/npm.html
11 11
<h2 id="SYNOPSIS">SYNOPSIS</h2>
12 12

  
13 13
<pre><code>var npm = require(&quot;npm&quot;)
14
npm.load(configObject, function (er, npm) {
14
npm.load([configObject,] function (er, npm) {
15 15
  // use the npm object, now that it&#39;s loaded.
16 16

  
17 17
  npm.config.set(key, val)
......
24 24

  
25 25
<h2 id="VERSION">VERSION</h2>
26 26

  
27
<p>1.2.2</p>
27
<p>1.2.10</p>
28 28

  
29 29
<h2 id="DESCRIPTION">DESCRIPTION</h2>
30 30

  
......
32 32
To find documentation of the command line
33 33
client, see <code><a href="../doc/npm.html">npm(1)</a></code>.</p>
34 34

  
35
<p>Prior to using npm&#39;s commands,
36
<code>npm.load()</code> must be called with an object hash of
37
top-level configs.  In the npm command line client,
38
this set of configs is parsed from the command line options.  Additional
39
configuration params are loaded from two configuration files.  See
40
<code><a href="../doc/config.html">config(1)</a></code> for more information.</p>
35
<p>Prior to using npm&#39;s commands, <code>npm.load()</code> must be called.
36
If you provide <code>configObject</code> as an object hash of top-level
37
configs, they override the values stored in the various config
38
locations. In the npm command line client, this set of configs
39
is parsed from the command line options. Additional configuration
40
params are loaded from two configuration files. See <code><a href="../doc/config.html">config(1)</a></code>
41
for more information.</p>
41 42

  
42 43
<p>After that, each of the functions are accessible in the
43 44
commands object: <code>npm.commands.&lt;cmd&gt;</code>.  See <code><a href="../doc/index.html">index(1)</a></code> for a list of
......
91 92

  
92 93
<pre><code>var cmd = npm.deref(&quot;unp&quot;) // cmd === &quot;unpublish&quot;</code></pre>
93 94
</div>
94
<p id="footer">npm &mdash; npm@1.2.2</p>
95
<p id="footer">npm &mdash; npm@1.2.10</p>
95 96
<script>
96 97
;(function () {
97 98
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/outdated.html
19 19

  
20 20
<p>If the &#39;packages&#39; parameter is left out, npm will check all packages.</p>
21 21
</div>
22
<p id="footer">outdated &mdash; npm@1.2.2</p>
22
<p id="footer">outdated &mdash; npm@1.2.10</p>
23 23
<script>
24 24
;(function () {
25 25
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/owner.html
34 34

  
35 35
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
36 36
</div>
37
<p id="footer">owner &mdash; npm@1.2.2</p>
37
<p id="footer">owner &mdash; npm@1.2.10</p>
38 38
<script>
39 39
;(function () {
40 40
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/pack.html
25 25

  
26 26
<p>If no arguments are supplied, then npm packs the current package folder.</p>
27 27
</div>
28
<p id="footer">pack &mdash; npm@1.2.2</p>
28
<p id="footer">pack &mdash; npm@1.2.10</p>
29 29
<script>
30 30
;(function () {
31 31
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/prefix.html
21 21

  
22 22
<p>This function is not useful programmatically</p>
23 23
</div>
24
<p id="footer">prefix &mdash; npm@1.2.2</p>
24
<p id="footer">prefix &mdash; npm@1.2.10</p>
25 25
<script>
26 26
;(function () {
27 27
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/prune.html
23 23
<p>Extraneous packages are packages that are not listed on the parent
24 24
package&#39;s dependencies list.</p>
25 25
</div>
26
<p id="footer">prune &mdash; npm@1.2.2</p>
26
<p id="footer">prune &mdash; npm@1.2.10</p>
27 27
<script>
28 28
;(function () {
29 29
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/publish.html
32 32

  
33 33
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../api/owner.html">owner(3)</a></li></ul>
34 34
</div>
35
<p id="footer">publish &mdash; npm@1.2.2</p>
35
<p id="footer">publish &mdash; npm@1.2.10</p>
36 36
<script>
37 37
;(function () {
38 38
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/rebuild.html
22 22

  
23 23
<p>See <code>npm help build</code></p>
24 24
</div>
25
<p id="footer">rebuild &mdash; npm@1.2.2</p>
25
<p id="footer">rebuild &mdash; npm@1.2.10</p>
26 26
<script>
27 27
;(function () {
28 28
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/restart.html
27 27

  
28 28
<ul><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
29 29
</div>
30
<p id="footer">restart &mdash; npm@1.2.2</p>
30
<p id="footer">restart &mdash; npm@1.2.10</p>
31 31
<script>
32 32
;(function () {
33 33
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/root.html
21 21

  
22 22
<p>This function is not useful programmatically.</p>
23 23
</div>
24
<p id="footer">root &mdash; npm@1.2.2</p>
24
<p id="footer">root &mdash; npm@1.2.10</p>
25 25
<script>
26 26
;(function () {
27 27
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/run-script.html
29 29

  
30 30
<ul><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../api/test.html">test(3)</a></li><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/restart.html">restart(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
31 31
</div>
32
<p id="footer">run-script &mdash; npm@1.2.2</p>
32
<p id="footer">run-script &mdash; npm@1.2.10</p>
33 33
<script>
34 34
;(function () {
35 35
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/search.html
32 32
and doesn&#39;t try to read your mind (it doesn&#39;t do any verb tense matching or the
33 33
like).</p>
34 34
</div>
35
<p id="footer">search &mdash; npm@1.2.2</p>
35
<p id="footer">search &mdash; npm@1.2.10</p>
36 36
<script>
37 37
;(function () {
38 38
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/shrinkwrap.html
26 26
<p>Finally, &#39;callback&#39; is a function that will be called when the shrinkwrap has
27 27
been saved.</p>
28 28
</div>
29
<p id="footer">shrinkwrap &mdash; npm@1.2.2</p>
29
<p id="footer">shrinkwrap &mdash; npm@1.2.10</p>
30 30
<script>
31 31
;(function () {
32 32
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/start.html
19 19
<p>npm can run tests on multiple packages. Just specify multiple packages
20 20
in the <code>packages</code> parameter.</p>
21 21
</div>
22
<p id="footer">start &mdash; npm@1.2.2</p>
22
<p id="footer">start &mdash; npm@1.2.10</p>
23 23
<script>
24 24
;(function () {
25 25
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/stop.html
19 19
<p>npm can run stop on multiple packages. Just specify multiple packages
20 20
in the <code>packages</code> parameter.</p>
21 21
</div>
22
<p id="footer">stop &mdash; npm@1.2.2</p>
22
<p id="footer">stop &mdash; npm@1.2.10</p>
23 23
<script>
24 24
;(function () {
25 25
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/submodule.html
33 33

  
34 34
<ul><li>npm help json</li><li>git help submodule</li></ul>
35 35
</div>
36
<p id="footer">submodule &mdash; npm@1.2.2</p>
36
<p id="footer">submodule &mdash; npm@1.2.10</p>
37 37
<script>
38 38
;(function () {
39 39
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/tag.html
29 29
used. For more information about how to set this config, check
30 30
<code>man 3 npm-config</code> for programmatic usage or <code>man npm-config</code> for cli usage.</p>
31 31
</div>
32
<p id="footer">tag &mdash; npm@1.2.2</p>
32
<p id="footer">tag &mdash; npm@1.2.10</p>
33 33
<script>
34 34
;(function () {
35 35
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/test.html
22 22
<p>npm can run tests on multiple packages. Just specify multiple packages
23 23
in the <code>packages</code> parameter.</p>
24 24
</div>
25
<p id="footer">test &mdash; npm@1.2.2</p>
25
<p id="footer">test &mdash; npm@1.2.10</p>
26 26
<script>
27 27
;(function () {
28 28
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/uninstall.html
22 22
<p>Finally, &#39;callback&#39; is a function that will be called when all packages have been
23 23
uninstalled or when an error has been encountered.</p>
24 24
</div>
25
<p id="footer">uninstall &mdash; npm@1.2.2</p>
25
<p id="footer">uninstall &mdash; npm@1.2.10</p>
26 26
<script>
27 27
;(function () {
28 28
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/unpublish.html
26 26
<p>If no version is specified, or if all versions are removed then
27 27
the root package entry is removed from the registry entirely.</p>
28 28
</div>
29
<p id="footer">unpublish &mdash; npm@1.2.2</p>
29
<p id="footer">unpublish &mdash; npm@1.2.10</p>
30 30
<script>
31 31
;(function () {
32 32
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/update.html
18 18

  
19 19
<p>The &#39;packages&#39; argument is an array of packages to update. The &#39;callback&#39; parameter will be called when done or when an error occurs.</p>
20 20
</div>
21
<p id="footer">update &mdash; npm@1.2.2</p>
21
<p id="footer">update &mdash; npm@1.2.10</p>
22 22
<script>
23 23
;(function () {
24 24
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/version.html
24 24
parameter. The difference, however, is this function will fail if it does
25 25
not have exactly one element. The only element should be a version number.</p>
26 26
</div>
27
<p id="footer">version &mdash; npm@1.2.2</p>
27
<p id="footer">version &mdash; npm@1.2.10</p>
28 28
<script>
29 29
;(function () {
30 30
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/view.html
99 99

  
100 100
<p>corresponding to the list of fields selected.</p>
101 101
</div>
102
<p id="footer">view &mdash; npm@1.2.2</p>
102
<p id="footer">view &mdash; npm@1.2.10</p>
103 103
<script>
104 104
;(function () {
105 105
var wrapper = document.getElementById("wrapper")
deps/npm/html/api/whoami.html
21 21

  
22 22
<p>This function is not useful programmatically</p>
23 23
</div>
24
<p id="footer">whoami &mdash; npm@1.2.2</p>
24
<p id="footer">whoami &mdash; npm@1.2.10</p>
25 25
<script>
26 26
;(function () {
27 27
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/README.html
240 240

  
241 241
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/index.html">index(1)</a></li></ul>
242 242
</div>
243
<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.2.2</p>
243
<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.2.10</p>
244 244
<script>
245 245
;(function () {
246 246
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/adduser.html
39 39

  
40 40
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li><li><a href="../doc/whoami.html">whoami(1)</a></li></ul>
41 41
</div>
42
<p id="footer">adduser &mdash; npm@1.2.2</p>
42
<p id="footer">adduser &mdash; npm@1.2.10</p>
43 43
<script>
44 44
;(function () {
45 45
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/bin.html
20 20

  
21 21
<ul><li><a href="../doc/prefix.html">prefix(1)</a></li><li><a href="../doc/root.html">root(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
22 22
</div>
23
<p id="footer">bin &mdash; npm@1.2.2</p>
23
<p id="footer">bin &mdash; npm@1.2.10</p>
24 24
<script>
25 25
;(function () {
26 26
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/bugs.html
36 36

  
37 37
<ul><li><a href="../doc/docs.html">docs(1)</a></li><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
38 38
</div>
39
<p id="footer">bugs &mdash; npm@1.2.2</p>
39
<p id="footer">bugs &mdash; npm@1.2.10</p>
40 40
<script>
41 41
;(function () {
42 42
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/build.html
25 25

  
26 26
<ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
27 27
</div>
28
<p id="footer">build &mdash; npm@1.2.2</p>
28
<p id="footer">build &mdash; npm@1.2.10</p>
29 29
<script>
30 30
;(function () {
31 31
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/bundle.html
20 20

  
21 21
<ul><li><a href="../doc/install.html">install(1)</a></li></ul>
22 22
</div>
23
<p id="footer">bundle &mdash; npm@1.2.2</p>
23
<p id="footer">bundle &mdash; npm@1.2.10</p>
24 24
<script>
25 25
;(function () {
26 26
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/cache.html
66 66

  
67 67
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li></ul>
68 68
</div>
69
<p id="footer">cache &mdash; npm@1.2.2</p>
69
<p id="footer">cache &mdash; npm@1.2.10</p>
70 70
<script>
71 71
;(function () {
72 72
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/changelog.html
65 65

  
66 66
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li></ul>
67 67
</div>
68
<p id="footer">changelog &mdash; npm@1.2.2</p>
68
<p id="footer">changelog &mdash; npm@1.2.10</p>
69 69
<script>
70 70
;(function () {
71 71
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/coding-style.html
182 182

  
183 183
<ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
184 184
</div>
185
<p id="footer">coding-style &mdash; npm@1.2.2</p>
185
<p id="footer">coding-style &mdash; npm@1.2.10</p>
186 186
<script>
187 187
;(function () {
188 188
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/completion.html
33 33

  
34 34
<ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
35 35
</div>
36
<p id="footer">completion &mdash; npm@1.2.2</p>
36
<p id="footer">completion &mdash; npm@1.2.10</p>
37 37
<script>
38 38
;(function () {
39 39
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/config.html
152 152
<p>Force npm to always require authentication when accessing the registry,
153 153
even for <code>GET</code> requests.</p>
154 154

  
155
<h3 id="bin-links">bin-links</h3>
156

  
157
<ul><li>Default: <code>true</code></li><li>Type: Boolean</li></ul>
158

  
159
<p>Tells npm to create symlinks (or <code>.cmd</code> shims on Windows) for package
160
executables.</p>
161

  
162
<p>Set to false to have it not do this.  This can be used to work around
163
the fact that some file systems don&#39;t support symlinks, even on
164
ostensibly Unix systems.</p>
165

  
155 166
<h3 id="browser">browser</h3>
156 167

  
157 168
<ul><li>Default: OS X: <code>&quot;open&quot;</code>, others: <code>&quot;google-chrome&quot;</code></li><li>Type: String</li></ul>
......
206 217

  
207 218
<h3 id="cache-min">cache-min</h3>
208 219

  
209
<ul><li>Default: 0</li><li>Type: Number</li></ul>
220
<ul><li>Default: 10</li><li>Type: Number</li></ul>
210 221

  
211 222
<p>The minimum time (in seconds) to keep items in the registry cache before
212 223
re-checking against the registry.</p>
......
317 328
<code>prefix</code> folder instead of the current working directory.  See
318 329
<code><a href="../doc/folders.html">folders(1)</a></code> for more on the differences in behavior.</p>
319 330

  
320
<ul><li>packages are installed into the <code>prefix/node_modules</code> folder, instead of the
321
current working directory.</li><li>bin files are linked to <code>prefix/bin</code></li><li>man pages are linked to <code>prefix/share/man</code></li></ul>
331
<ul><li>packages are installed into the <code>{prefix}/lib/node_modules</code> folder, instead of the
332
current working directory.</li><li>bin files are linked to <code>{prefix}/bin</code></li><li>man pages are linked to <code>{prefix}/share/man</code></li></ul>
322 333

  
323 334
<h3 id="globalconfig">globalconfig</h3>
324 335

  
......
352 363

  
353 364
<h3 id="user-agent">user-agent</h3>
354 365

  
355
<ul><li>Default: npm/{npm.version} node/{process.version}</li><li>Type: String</li></ul>
366
<ul><li>Default: node/{process.version} {process.platform} {process.arch}</li><li>Type: String</li></ul>
356 367

  
357 368
<p>Sets a User-Agent to the request header</p>
358 369

  
......
501 512

  
502 513
<h3 id="prefix">prefix</h3>
503 514

  
504
<ul><li>Default: node&#39;s process.installPrefix</li><li>Type: path</li></ul>
515
<ul><li>Default: see <a href="../doc/folders.html">folders(1)</a></li><li>Type: path</li></ul>
505 516

  
506 517
<p>The location to install global items.  If set on the command line, then
507 518
it forces non-global commands to run in the specified folder.</p>
......
756 767

  
757 768
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
758 769
</div>
759
<p id="footer">config &mdash; npm@1.2.2</p>
770
<p id="footer">config &mdash; npm@1.2.10</p>
760 771
<script>
761 772
;(function () {
762 773
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/dedupe.html
57 57

  
58 58
<ul><li><a href="../doc/ls.html">ls(1)</a></li><li><a href="../doc/update.html">update(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
59 59
</div>
60
<p id="footer">dedupe &mdash; npm@1.2.2</p>
60
<p id="footer">dedupe &mdash; npm@1.2.10</p>
61 61
<script>
62 62
;(function () {
63 63
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/deprecate.html
31 31

  
32 32
<ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
33 33
</div>
34
<p id="footer">deprecate &mdash; npm@1.2.2</p>
34
<p id="footer">deprecate &mdash; npm@1.2.10</p>
35 35
<script>
36 36
;(function () {
37 37
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/developers.html
160 160

  
161 161
<ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
162 162
</div>
163
<p id="footer">developers &mdash; npm@1.2.2</p>
163
<p id="footer">developers &mdash; npm@1.2.10</p>
164 164
<script>
165 165
;(function () {
166 166
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/disputes.html
86 86

  
87 87
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li></ul>
88 88
</div>
89
<p id="footer">disputes &mdash; npm@1.2.2</p>
89
<p id="footer">disputes &mdash; npm@1.2.10</p>
90 90
<script>
91 91
;(function () {
92 92
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/docs.html
37 37

  
38 38
<ul><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
39 39
</div>
40
<p id="footer">docs &mdash; npm@1.2.2</p>
40
<p id="footer">docs &mdash; npm@1.2.10</p>
41 41
<script>
42 42
;(function () {
43 43
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/edit.html
37 37

  
38 38
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/explore.html">explore(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
39 39
</div>
40
<p id="footer">edit &mdash; npm@1.2.2</p>
40
<p id="footer">edit &mdash; npm@1.2.10</p>
41 41
<script>
42 42
;(function () {
43 43
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/explore.html
40 40

  
41 41
<ul><li><a href="../doc/submodule.html">submodule(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/edit.html">edit(1)</a></li><li><a href="../doc/rebuild.html">rebuild(1)</a></li><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
42 42
</div>
43
<p id="footer">explore &mdash; npm@1.2.2</p>
43
<p id="footer">explore &mdash; npm@1.2.10</p>
44 44
<script>
45 45
;(function () {
46 46
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/faq.html
250 250

  
251 251
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li></ul>
252 252
</div>
253
<p id="footer">faq &mdash; npm@1.2.2</p>
253
<p id="footer">faq &mdash; npm@1.2.10</p>
254 254
<script>
255 255
;(function () {
256 256
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/folders.html
205 205

  
206 206
<ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li></ul>
207 207
</div>
208
<p id="footer">folders &mdash; npm@1.2.2</p>
208
<p id="footer">folders &mdash; npm@1.2.10</p>
209 209
<script>
210 210
;(function () {
211 211
var wrapper = document.getElementById("wrapper")
deps/npm/html/doc/global.html
1
<!doctype html>
2
<html>
3
  <title>global</title>
4
  <meta http-equiv="content-type" value="text/html;utf-8">
5
  <link rel="stylesheet" type="text/css" href="../static/style.css">
6

  
7
  <body>
8
    <div id="wrapper">
9
<h1><a href="../doc/folders.html">folders</a></h1> <p>Folder Structures Used by npm</p>
10

  
11
<h2 id="DESCRIPTION">DESCRIPTION</h2>
12

  
13
<p>npm puts various things on your computer.  That&#39;s its job.</p>
14

  
15
<p>This document will tell you what it puts where.</p>
16

  
17
<h3 id="tl-dr">tl;dr</h3>
18

  
19
<ul><li>Local install (default): puts stuff in <code>./node_modules</code> of the current
20
package root.</li><li>Global install (with <code>-g</code>): puts stuff in /usr/local or wherever node
21
is installed.</li><li>Install it <strong>locally</strong> if you&#39;re going to <code>require()</code> it.</li><li>Install it <strong>globally</strong> if you&#39;re going to run it on the command line.</li><li>If you need both, then install it in both places, or use <code>npm link</code>.</li></ul>
22

  
23
<h3 id="prefix-Configuration">prefix Configuration</h3>
24

  
25
<p>The <code>prefix</code> config defaults to the location where node is installed.
26
On most systems, this is <code>/usr/local</code>, and most of the time is the same
27
as node&#39;s <code>process.installPrefix</code>.</p>
28

  
29
<p>On windows, this is the exact location of the node.exe binary.  On Unix
30
systems, it&#39;s one level up, since node is typically installed at
31
<code>{prefix}/bin/node</code> rather than <code>{prefix}/node.exe</code>.</p>
32

  
33
<p>When the <code>global</code> flag is set, npm installs things into this prefix.
34
When it is not set, it uses the root of the current package, or the
35
current working directory if not in a package already.</p>
36

  
37
<h3 id="Node-Modules">Node Modules</h3>
38

  
39
<p>Packages are dropped into the <code>node_modules</code> folder under the <code>prefix</code>.
40
When installing locally, this means that you can
41
<code>require(&quot;packagename&quot;)</code> to load its main module, or
42
<code>require(&quot;packagename/lib/path/to/sub/module&quot;)</code> to load other modules.</p>
43

  
44
<p>Global installs on Unix systems go to <code>{prefix}/lib/node_modules</code>.
45
Global installs on Windows go to <code>{prefix}/node_modules</code> (that is, no
46
<code>lib</code> folder.)</p>
47

  
48
<p>If you wish to <code>require()</code> a package, then install it locally.</p>
49

  
50
<h3 id="Executables">Executables</h3>
51

  
52
<p>When in global mode, executables are linked into <code>{prefix}/bin</code> on Unix,
53
or directly into <code>{prefix}</code> on Windows.</p>
54

  
55
<p>When in local mode, executables are linked into
56
<code>./node_modules/.bin</code> so that they can be made available to scripts run
57
through npm.  (For example, so that a test runner will be in the path
58
when you run <code>npm test</code>.)</p>
59

  
60
<h3 id="Man-Pages">Man Pages</h3>
61

  
62
<p>When in global mode, man pages are linked into <code>{prefix}/share/man</code>.</p>
63

  
64
<p>When in local mode, man pages are not installed.</p>
65

  
66
<p>Man pages are not installed on Windows systems.</p>
67

  
68
<h3 id="Cache">Cache</h3>
69

  
70
<p>See <code><a href="../doc/cache.html">cache(1)</a></code>.  Cache files are stored in <code>~/.npm</code> on Posix, or
71
<code>~/npm-cache</code> on Windows.</p>
72

  
73
<p>This is controlled by the <code>cache</code> configuration param.</p>
74

  
75
<h3 id="Temp-Files">Temp Files</h3>
76

  
77
<p>Temporary files are stored by default in the folder specified by the
78
<code>tmp</code> config, which defaults to the TMPDIR, TMP, or TEMP environment
79
variables, or <code>/tmp</code> on Unix and <code>c:\windows\temp</code> on Windows.</p>
80

  
81
<p>Temp files are given a unique folder under this root for each run of the
82
program, and are deleted upon successful exit.</p>
83

  
84
<h2 id="More-Information">More Information</h2>
85

  
86
<p>When installing locally, npm first tries to find an appropriate
87
<code>prefix</code> folder.  This is so that <code>npm install foo@1.2.3</code> will install
88
to the sensible root of your package, even if you happen to have <code>cd</code>ed
89
into some other folder.</p>
90

  
91
<p>Starting at the $PWD, npm will walk up the folder tree checking for a
92
folder that contains either a <code>package.json</code> file, or a <code>node_modules</code>
93
folder.  If such a thing is found, then that is treated as the effective
94
&quot;current directory&quot; for the purpose of running npm commands.  (This
95
behavior is inspired by and similar to git&#39;s .git-folder seeking
96
logic when running git commands in a working dir.)</p>
97

  
98
<p>If no package root is found, then the current folder is used.</p>
99

  
100
<p>When you run <code>npm install foo@1.2.3</code>, then the package is loaded into
101
the cache, and then unpacked into <code>./node_modules/foo</code>.  Then, any of
102
foo&#39;s dependencies are similarly unpacked into
103
<code>./node_modules/foo/node_modules/...</code>.</p>
104

  
105
<p>Any bin files are symlinked to <code>./node_modules/.bin/</code>, so that they may
106
be found by npm scripts when necessary.</p>
107

  
108
<h3 id="Global-Installation">Global Installation</h3>
109

  
110
<p>If the <code>global</code> configuration is set to true, then npm will
111
install packages &quot;globally&quot;.</p>
112

  
113
<p>For global installation, packages are installed roughly the same way,
114
but using the folders described above.</p>
115

  
116
<h3 id="Cycles-Conflicts-and-Folder-Parsimony">Cycles, Conflicts, and Folder Parsimony</h3>
117

  
118
<p>Cycles are handled using the property of node&#39;s module system that it
119
walks up the directories looking for <code>node_modules</code> folders.  So, at every
120
stage, if a package is already installed in an ancestor <code>node_modules</code>
121
folder, then it is not installed at the current location.</p>
122

  
123
<p>Consider the case above, where <code>foo -&gt; bar -&gt; baz</code>.  Imagine if, in
124
addition to that, baz depended on bar, so you&#39;d have:
125
<code>foo -&gt; bar -&gt; baz -&gt; bar -&gt; baz ...</code>.  However, since the folder
126
structure is: <code>foo/node_modules/bar/node_modules/baz</code>, there&#39;s no need to
127
put another copy of bar into <code>.../baz/node_modules</code>, since when it calls
128
require(&quot;bar&quot;), it will get the copy that is installed in
129
<code>foo/node_modules/bar</code>.</p>
130

  
131
<p>This shortcut is only used if the exact same
132
version would be installed in multiple nested <code>node_modules</code> folders.  It
133
is still possible to have <code>a/node_modules/b/node_modules/a</code> if the two
134
&quot;a&quot; packages are different versions.  However, without repeating the
135
exact same package multiple times, an infinite regress will always be
136
prevented.</p>
137

  
138
<p>Another optimization can be made by installing dependencies at the
139
highest level possible, below the localized &quot;target&quot; folder.</p>
140

  
141
<h4 id="Example">Example</h4>
142

  
143
<p>Consider this dependency graph:</p>
144

  
145
<pre><code>foo
146
+-- blerg@1.2.5
147
+-- bar@1.2.3
148
|   +-- blerg@1.x (latest=1.3.7)
149
|   +-- baz@2.x
150
|   |   `-- quux@3.x
151
|   |       `-- bar@1.2.3 (cycle)
152
|   `-- asdf@*
153
`-- baz@1.2.3
154
    `-- quux@3.x
155
        `-- bar</code></pre>
156

  
157
<p>In this case, we might expect a folder structure like this:</p>
158

  
159
<pre><code>foo
160
+-- node_modules
161
    +-- blerg (1.2.5) &lt;---[A]
162
    +-- bar (1.2.3) &lt;---[B]
163
    |   +-- node_modules
164
    |   |   `-- baz (2.0.2) &lt;---[C]
165
    |   |       `-- node_modules
166
    |   |           `-- quux (3.2.0)
167
    |   `-- asdf (2.3.4)
168
    `-- baz (1.2.3) &lt;---[D]
169
        `-- node_modules
170
            `-- quux (3.2.0) &lt;---[E]</code></pre>
171

  
172
<p>Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are
173
installed in foo&#39;s <code>node_modules</code> folder.</p>
174

  
175
<p>Even though the latest copy of blerg is 1.3.7, foo has a specific
176
dependency on version 1.2.5.  So, that gets installed at [A].  Since the
177
parent installation of blerg satisfie&#39;s bar&#39;s dependency on blerg@1.x,
178
it does not install another copy under [B].</p>
179

  
180
<p>Bar [B] also has dependencies on baz and asdf, so those are installed in
181
bar&#39;s <code>node_modules</code> folder.  Because it depends on <code>baz@2.x</code>, it cannot
182
re-use the <code>baz@1.2.3</code> installed in the parent <code>node_modules</code> folder [D],
183
and must install its own copy [C].</p>
184

  
185
<p>Underneath bar, the <code>baz-&gt;quux-&gt;bar</code> dependency creates a cycle.
186
However, because <code>bar</code> is already in <code>quux</code>&#39;s ancestry [B], it does not
187
unpack another copy of bar into that folder.</p>
188

  
189
<p>Underneath <code>foo-&gt;baz</code> [D], quux&#39;s [E] folder tree is empty, because its
190
dependency on bar is satisfied by the parent folder copy installed at [B].</p>
191

  
192
<p>For a graphical breakdown of what is installed where, use <code>npm ls</code>.</p>
193

  
194
<h3 id="Publishing">Publishing</h3>
195

  
196
<p>Upon publishing, npm will look in the <code>node_modules</code> folder.  If any of
197
the items there are not in the <code>bundledDependencies</code> array, then they will
198
not be included in the package tarball.</p>
199

  
200
<p>This allows a package maintainer to install all of their dependencies
201
(and dev dependencies) locally, but only re-publish those items that
202
cannot be found elsewhere.  See <code><a href="../doc/json.html">json(1)</a></code> for more information.</p>
203

  
204
<h2 id="SEE-ALSO">SEE ALSO</h2>
205

  
206
<ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li></ul>
207
</div>
208
<p id="footer">global &mdash; npm@1.2.10</p>
209
<script>
210
;(function () {
211
var wrapper = document.getElementById("wrapper")
212
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
213
  .filter(function (el) {
214
    return el.parentNode === wrapper
215
        && el.tagName.match(/H[1-6]/)
216
        && el.id
217
  })
218
var l = 2
219
  , toc = document.createElement("ul")
220
toc.innerHTML = els.map(function (el) {
221
  var i = el.tagName.charAt(1)
222
    , out = ""
223
  while (i > l) {
224
    out += "<ul>"
225
    l ++
226
  }
227
  while (i < l) {
228
    out += "</ul>"
229
    l --
230
  }
231
  out += "<li><a href='#" + el.id + "'>" +
232
    ( el.innerText || el.text || el.innerHTML)
233
    + "</a>"
234
  return out
235
}).join("\n")
236
toc.id = "toc"
237
document.body.appendChild(toc)
238
})()
239
</script>
240
</body></html>
deps/npm/html/doc/help-search.html
38 38

  
39 39
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li></ul>
40 40
</div>
41
<p id="footer">help-search &mdash; npm@1.2.2</p>
41
<p id="footer">help-search &mdash; npm@1.2.10</p>
42 42
<script>
43 43
;(function () {
44 44
var wrapper = document.getElementById("wrapper")
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff