Permalink
Browse files

npm: Upgrade to v1.2.10

  • Loading branch information...
1 parent a86ebbe commit 5aef65a98a9427bcd6f41d8f65235bd26883d2d7 @isaacs isaacs committed Feb 6, 2013
Showing with 2,139 additions and 749 deletions.
  1. +2 −0 deps/npm/AUTHORS
  2. +8 −7 deps/npm/doc/api/npm.md
  3. +18 −6 deps/npm/doc/cli/config.md
  4. +209 −0 deps/npm/doc/cli/global.md
  5. +8 −0 deps/npm/doc/cli/index.md
  6. +3 −0 deps/npm/doc/cli/install.md
  7. +19 −0 deps/npm/doc/cli/rm.md
  8. +1 −1 deps/npm/html/api/bin.html
  9. +1 −1 deps/npm/html/api/bugs.html
  10. +1 −1 deps/npm/html/api/commands.html
  11. +1 −1 deps/npm/html/api/config.html
  12. +1 −1 deps/npm/html/api/deprecate.html
  13. +1 −1 deps/npm/html/api/docs.html
  14. +1 −1 deps/npm/html/api/edit.html
  15. +1 −1 deps/npm/html/api/explore.html
  16. +1 −1 deps/npm/html/api/help-search.html
  17. +1 −1 deps/npm/html/api/init.html
  18. +1 −1 deps/npm/html/api/install.html
  19. +1 −1 deps/npm/html/api/link.html
  20. +1 −1 deps/npm/html/api/load.html
  21. +1 −1 deps/npm/html/api/ls.html
  22. +10 −9 deps/npm/html/api/npm.html
  23. +1 −1 deps/npm/html/api/outdated.html
  24. +1 −1 deps/npm/html/api/owner.html
  25. +1 −1 deps/npm/html/api/pack.html
  26. +1 −1 deps/npm/html/api/prefix.html
  27. +1 −1 deps/npm/html/api/prune.html
  28. +1 −1 deps/npm/html/api/publish.html
  29. +1 −1 deps/npm/html/api/rebuild.html
  30. +1 −1 deps/npm/html/api/restart.html
  31. +1 −1 deps/npm/html/api/root.html
  32. +1 −1 deps/npm/html/api/run-script.html
  33. +1 −1 deps/npm/html/api/search.html
  34. +1 −1 deps/npm/html/api/shrinkwrap.html
  35. +1 −1 deps/npm/html/api/start.html
  36. +1 −1 deps/npm/html/api/stop.html
  37. +1 −1 deps/npm/html/api/submodule.html
  38. +1 −1 deps/npm/html/api/tag.html
  39. +1 −1 deps/npm/html/api/test.html
  40. +1 −1 deps/npm/html/api/uninstall.html
  41. +1 −1 deps/npm/html/api/unpublish.html
  42. +1 −1 deps/npm/html/api/update.html
  43. +1 −1 deps/npm/html/api/version.html
  44. +1 −1 deps/npm/html/api/view.html
  45. +1 −1 deps/npm/html/api/whoami.html
  46. +1 −1 deps/npm/html/doc/README.html
  47. +1 −1 deps/npm/html/doc/adduser.html
  48. +1 −1 deps/npm/html/doc/bin.html
  49. +1 −1 deps/npm/html/doc/bugs.html
  50. +1 −1 deps/npm/html/doc/build.html
  51. +1 −1 deps/npm/html/doc/bundle.html
  52. +1 −1 deps/npm/html/doc/cache.html
  53. +1 −1 deps/npm/html/doc/changelog.html
  54. +1 −1 deps/npm/html/doc/coding-style.html
  55. +1 −1 deps/npm/html/doc/completion.html
  56. +17 −6 deps/npm/html/doc/config.html
  57. +1 −1 deps/npm/html/doc/dedupe.html
  58. +1 −1 deps/npm/html/doc/deprecate.html
  59. +1 −1 deps/npm/html/doc/developers.html
  60. +1 −1 deps/npm/html/doc/disputes.html
  61. +1 −1 deps/npm/html/doc/docs.html
  62. +1 −1 deps/npm/html/doc/edit.html
  63. +1 −1 deps/npm/html/doc/explore.html
  64. +1 −1 deps/npm/html/doc/faq.html
  65. +1 −1 deps/npm/html/doc/folders.html
  66. +240 −0 deps/npm/html/doc/global.html
  67. +1 −1 deps/npm/html/doc/help-search.html
  68. +1 −1 deps/npm/html/doc/help.html
  69. +9 −1 deps/npm/html/doc/index.html
  70. +1 −1 deps/npm/html/doc/init.html
  71. +4 −1 deps/npm/html/doc/install.html
  72. +1 −1 deps/npm/html/doc/json.html
  73. +1 −1 deps/npm/html/doc/link.html
  74. +2 −2 deps/npm/html/doc/ls.html
  75. +2 −2 deps/npm/html/doc/npm.html
  76. +1 −1 deps/npm/html/doc/outdated.html
  77. +1 −1 deps/npm/html/doc/owner.html
  78. +1 −1 deps/npm/html/doc/pack.html
  79. +1 −1 deps/npm/html/doc/prefix.html
  80. +1 −1 deps/npm/html/doc/prune.html
  81. +1 −1 deps/npm/html/doc/publish.html
  82. +1 −1 deps/npm/html/doc/rebuild.html
  83. +1 −1 deps/npm/html/doc/registry.html
  84. +1 −1 deps/npm/html/doc/removing-npm.html
  85. +1 −1 deps/npm/html/doc/restart.html
  86. +57 −0 deps/npm/html/doc/rm.html
  87. +1 −1 deps/npm/html/doc/root.html
  88. +1 −1 deps/npm/html/doc/run-script.html
  89. +1 −1 deps/npm/html/doc/scripts.html
  90. +1 −1 deps/npm/html/doc/search.html
  91. +1 −1 deps/npm/html/doc/semver.html
  92. +1 −1 deps/npm/html/doc/shrinkwrap.html
  93. +1 −1 deps/npm/html/doc/star.html
  94. +1 −1 deps/npm/html/doc/start.html
  95. +1 −1 deps/npm/html/doc/stop.html
  96. +1 −1 deps/npm/html/doc/submodule.html
  97. +1 −1 deps/npm/html/doc/tag.html
  98. +1 −1 deps/npm/html/doc/test.html
  99. +1 −1 deps/npm/html/doc/uninstall.html
  100. +1 −1 deps/npm/html/doc/unpublish.html
  101. +1 −1 deps/npm/html/doc/update.html
  102. +1 −1 deps/npm/html/doc/version.html
  103. +1 −1 deps/npm/html/doc/view.html
  104. +1 −1 deps/npm/html/doc/whoami.html
  105. +4 −1 deps/npm/lib/build.js
  106. +22 −13 deps/npm/lib/cache.js
  107. +13 −2 deps/npm/lib/dedupe.js
  108. +97 −14 deps/npm/lib/install.js
  109. +1 −1 deps/npm/lib/link.js
  110. +5 −2 deps/npm/lib/outdated.js
  111. +1 −1 deps/npm/lib/publish.js
  112. +3 −3 deps/npm/lib/run-script.js
  113. +1 −1 deps/npm/lib/uninstall.js
  114. +1 −1 deps/npm/lib/unpublish.js
  115. +8 −0 deps/npm/lib/utils/error-handler.js
  116. +3 −0 deps/npm/lib/utils/lifecycle.js
  117. +67 −19 deps/npm/lib/utils/tar.js
  118. +1 −1 deps/npm/man/man1/README.1
  119. +1 −1 deps/npm/man/man1/adduser.1
  120. +1 −1 deps/npm/man/man1/bin.1
  121. +1 −1 deps/npm/man/man1/bugs.1
  122. +1 −1 deps/npm/man/man1/build.1
  123. +1 −1 deps/npm/man/man1/bundle.1
  124. +1 −1 deps/npm/man/man1/cache.1
  125. +1 −1 deps/npm/man/man1/changelog.1
  126. +1 −1 deps/npm/man/man1/coding-style.1
  127. +1 −1 deps/npm/man/man1/completion.1
  128. +26 −7 deps/npm/man/man1/config.1
  129. +1 −1 deps/npm/man/man1/dedupe.1
  130. +1 −1 deps/npm/man/man1/deprecate.1
  131. +1 −1 deps/npm/man/man1/developers.1
  132. +1 −1 deps/npm/man/man1/disputes.1
  133. +1 −1 deps/npm/man/man1/docs.1
  134. +1 −1 deps/npm/man/man1/edit.1
  135. +1 −1 deps/npm/man/man1/explore.1
  136. +1 −1 deps/npm/man/man1/faq.1
  137. +1 −1 deps/npm/man/man1/folders.1
  138. +4 −5 deps/npm/man/man1/global.1
  139. +1 −1 deps/npm/man/man1/help-search.1
  140. +1 −1 deps/npm/man/man1/help.1
  141. +7 −1 deps/npm/man/man1/index.1
  142. +1 −1 deps/npm/man/man1/init.1
  143. +5 −1 deps/npm/man/man1/install.1
  144. +1 −1 deps/npm/man/man1/json.1
  145. +1 −1 deps/npm/man/man1/link.1
  146. +2 −2 deps/npm/man/man1/ls.1
  147. +2 −2 deps/npm/man/man1/npm.1
  148. +1 −1 deps/npm/man/man1/outdated.1
  149. +1 −1 deps/npm/man/man1/owner.1
  150. +1 −1 deps/npm/man/man1/pack.1
  151. +1 −1 deps/npm/man/man1/prefix.1
  152. +1 −1 deps/npm/man/man1/prune.1
  153. +1 −1 deps/npm/man/man1/publish.1
  154. +1 −1 deps/npm/man/man1/rebuild.1
  155. +1 −1 deps/npm/man/man1/registry.1
  156. +1 −1 deps/npm/man/man1/removing-npm.1
  157. +1 −1 deps/npm/man/man1/restart.1
  158. +2 −2 deps/npm/man/man1/rm.1
  159. +1 −1 deps/npm/man/man1/root.1
  160. +1 −1 deps/npm/man/man1/run-script.1
  161. +1 −1 deps/npm/man/man1/scripts.1
  162. +1 −1 deps/npm/man/man1/search.1
  163. +1 −1 deps/npm/man/man1/semver.1
  164. +1 −1 deps/npm/man/man1/shrinkwrap.1
  165. +1 −1 deps/npm/man/man1/star.1
  166. +1 −1 deps/npm/man/man1/start.1
  167. +1 −1 deps/npm/man/man1/stop.1
  168. +1 −1 deps/npm/man/man1/submodule.1
  169. +1 −1 deps/npm/man/man1/tag.1
  170. +1 −1 deps/npm/man/man1/test.1
  171. +1 −1 deps/npm/man/man1/uninstall.1
  172. +1 −1 deps/npm/man/man1/unpublish.1
  173. +1 −1 deps/npm/man/man1/update.1
  174. +1 −1 deps/npm/man/man1/version.1
  175. +1 −1 deps/npm/man/man1/view.1
  176. +1 −1 deps/npm/man/man1/whoami.1
  177. +1 −1 deps/npm/man/man3/bin.3
  178. +1 −1 deps/npm/man/man3/bugs.3
  179. +1 −1 deps/npm/man/man3/commands.3
  180. +1 −1 deps/npm/man/man3/config.3
  181. +1 −1 deps/npm/man/man3/deprecate.3
  182. +1 −1 deps/npm/man/man3/docs.3
  183. +1 −1 deps/npm/man/man3/edit.3
  184. +1 −1 deps/npm/man/man3/explore.3
  185. +1 −1 deps/npm/man/man3/help-search.3
  186. +1 −1 deps/npm/man/man3/init.3
  187. +1 −1 deps/npm/man/man3/install.3
  188. +1 −1 deps/npm/man/man3/link.3
  189. +1 −1 deps/npm/man/man3/load.3
  190. +1 −1 deps/npm/man/man3/ls.3
  191. +10 −7 deps/npm/man/man3/npm.3
  192. +1 −1 deps/npm/man/man3/outdated.3
  193. +1 −1 deps/npm/man/man3/owner.3
  194. +1 −1 deps/npm/man/man3/pack.3
  195. +1 −1 deps/npm/man/man3/prefix.3
  196. +1 −1 deps/npm/man/man3/prune.3
  197. +1 −1 deps/npm/man/man3/publish.3
  198. +1 −1 deps/npm/man/man3/rebuild.3
  199. +1 −1 deps/npm/man/man3/restart.3
  200. +1 −1 deps/npm/man/man3/root.3
  201. +1 −1 deps/npm/man/man3/run-script.3
  202. +1 −1 deps/npm/man/man3/search.3
  203. +1 −1 deps/npm/man/man3/shrinkwrap.3
  204. +1 −1 deps/npm/man/man3/start.3
  205. +1 −1 deps/npm/man/man3/stop.3
  206. +1 −1 deps/npm/man/man3/submodule.3
  207. +1 −1 deps/npm/man/man3/tag.3
  208. +1 −1 deps/npm/man/man3/test.3
  209. +1 −1 deps/npm/man/man3/uninstall.3
  210. +1 −1 deps/npm/man/man3/unpublish.3
  211. +1 −1 deps/npm/man/man3/update.3
  212. +1 −1 deps/npm/man/man3/version.3
  213. +1 −1 deps/npm/man/man3/view.3
  214. +1 −1 deps/npm/man/man3/whoami.3
  215. +3 −3 deps/npm/node_modules/fstream/package.json
  216. +67 −18 deps/npm/node_modules/glob/glob.js
  217. +5 −8 deps/npm/node_modules/glob/package.json
  218. +122 −7 deps/npm/node_modules/glob/test/00-setup.js
  219. +30 −85 deps/npm/node_modules/glob/test/bash-comparison.js
  220. +347 −0 deps/npm/node_modules/glob/test/bash-results.json
  221. +39 −28 deps/npm/node_modules/glob/test/mark.js
  222. +8 −41 deps/npm/node_modules/glob/test/pause-resume.js
  223. +32 −29 deps/npm/node_modules/glob/test/root.js
  224. +7 −3 deps/npm/node_modules/graceful-fs/graceful-fs.js
  225. +4 −3 deps/npm/node_modules/graceful-fs/package.json
  226. +5 −0 deps/npm/node_modules/graceful-fs/test/open.js
  227. +9 −1 deps/npm/node_modules/ini/README.md
  228. +27 −3 deps/npm/node_modules/ini/ini.js
  229. +4 −3 deps/npm/node_modules/ini/package.json
  230. +15 −0 deps/npm/node_modules/ini/test/fixtures/foo.ini
  231. +13 −3 deps/npm/node_modules/ini/test/foo.js
  232. +12 −10 deps/npm/node_modules/lockfile/LICENSE
  233. +30 −48 deps/npm/node_modules/lockfile/lockfile.js
  234. +4 −3 deps/npm/node_modules/lockfile/package.json
  235. +43 −0 deps/npm/node_modules/lockfile/test/basic.js
  236. +5 −0 deps/npm/node_modules/node-gyp/README.md
  237. +4 −0 deps/npm/node_modules/node-gyp/addon.gypi
  238. +2 −2 deps/npm/node_modules/node-gyp/lib/build.js
  239. +14 −18 deps/npm/node_modules/node-gyp/lib/configure.js
  240. +6 −5 deps/npm/node_modules/node-gyp/package.json
  241. +1 −1 deps/npm/node_modules/npm-registry-client/README.md
  242. +5 −1 deps/npm/node_modules/npm-registry-client/node_modules/couch-login/package.json
  243. +5 −5 deps/npm/node_modules/npm-registry-client/package.json
  244. +14 −6 deps/npm/node_modules/npmconf/config-defs.js
  245. +1 −1 deps/npm/node_modules/npmconf/node_modules/config-chain/index.js
  246. +3 −3 deps/npm/node_modules/npmconf/node_modules/config-chain/package.json
  247. +6 −4 deps/npm/node_modules/npmconf/package.json
  248. +5 −5 deps/npm/node_modules/read-installed/package.json
  249. +17 −4 deps/npm/node_modules/read-installed/read-installed.js
  250. +4 −4 deps/npm/node_modules/read-package-json/package.json
  251. +5 −8 deps/npm/node_modules/rimraf/package.json
  252. +30 −6 deps/npm/node_modules/rimraf/rimraf.js
  253. +3 −3 deps/npm/node_modules/semver/package.json
  254. +1 −2 deps/npm/node_modules/semver/semver.js
  255. +27 −0 deps/npm/node_modules/semver/test.js
  256. +1 −1 deps/npm/node_modules/tar/.npmignore
  257. +2 −2 deps/npm/node_modules/tar/package.json
  258. +1 −0 deps/npm/node_modules/tar/tar.js
  259. +9 −8 deps/npm/package.json
  260. +0 −1 deps/npm/test/packages/npm-test-peer-deps-invalid/README
  261. +0 −21 deps/npm/test/packages/npm-test-peer-deps-invalid/npm-ls.json
  262. +0 −34 deps/npm/test/packages/npm-test-peer-deps-invalid/test.js
  263. +6 −1 deps/npm/test/packages/npm-test-peer-deps/test.js
  264. +1 −1 deps/npm/test/packages/npm-test-shrinkwrap/test.js
  265. +4 −5 deps/npm/test/tap/false_name.js
  266. +7 −0 deps/npm/test/tap/package-with-peer-dep/package.json
  267. +24 −0 deps/npm/test/tap/peer-deps-invalid.js
  268. +1 −4 deps/npm/test/{packages/npm-test-peer-deps-invalid → tap/peer-deps-invalid}/package.json
  269. +29 −0 deps/npm/test/tap/peer-deps-without-package-json.js
  270. 0 deps/npm/{node_modules/rimraf/test/test-fiber.js → test/tap/peer-deps-without-package-json/.gitkeep}
View
@@ -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>
View
@@ -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)
@@ -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
View
@@ -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"`
@@ -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
@@ -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
@@ -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
@@ -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
View
@@ -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)
@@ -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
@@ -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
@@ -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.
View
@@ -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)
@@ -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")
@@ -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")
@@ -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")
@@ -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")
Oops, something went wrong.

0 comments on commit 5aef65a

Please sign in to comment.