From: isaacs Date: Tue, 18 Jun 2013 16:42:42 +0000 (-0700) Subject: npm: Upgrade to 1.2.32 X-Git-Tag: v0.10.12~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9195455637be7ac68274c4e9a83003470efdb0c0;p=platform%2Fupstream%2Fnodejs.git npm: Upgrade to 1.2.32 --- diff --git a/deps/npm/Makefile b/deps/npm/Makefile index 82fa8b6..61251fb 100644 --- a/deps/npm/Makefile +++ b/deps/npm/Makefile @@ -102,9 +102,10 @@ test: node cli.js test publish: link doc - @git push origin :v$(shell npm -v) || true - @npm unpublish npm@$(shell npm -v) || true - git clean -fd + @git push origin :v$(shell npm -v) 2>&1 || true + @npm unpublish npm@$(shell npm -v) 2>&1 || true + git clean -fd &&\ + git push origin &&\ git push origin --tags &&\ npm publish &&\ npm tag npm@$(shell npm -v) $(shell npm -v | awk -F. '{print $$1 "." $$2}') &&\ diff --git a/deps/npm/doc/cli/faq.md b/deps/npm/doc/cli/faq.md index 05b2cd9..e00fec6 100644 --- a/deps/npm/doc/cli/faq.md +++ b/deps/npm/doc/cli/faq.md @@ -72,52 +72,6 @@ Write your own package manager, then. It's not that hard. npm will not help you do something that is known to be a bad idea. -## `"node_modules"` is the name of my deity's arch-rival, and a Forbidden Word in my religion. Can I configure npm to use a different folder? - -No. This will never happen. This question comes up sometimes, -because it seems silly from the outside that npm couldn't just be -configured to put stuff somewhere else, and then npm could load them -from there. It's an arbitrary spelling choice, right? What's the big -deal? - -At the time of this writing, the string `'node_modules'` appears 151 -times in 53 separate files in npm and node core (excluding tests and -documentation). - -Some of these references are in node's built-in module loader. Since -npm is not involved **at all** at run-time, node itself would have to -be configured to know where you've decided to stick stuff. Complexity -hurdle #1. Since the Node module system is locked, this cannot be -changed, and is enough to kill this request. But I'll continue, in -deference to your deity's delicate feelings regarding spelling. - -Many of the others are in dependencies that npm uses, which are not -necessarily tightly coupled to npm (in the sense that they do not read -npm's configuration files, etc.) Each of these would have to be -configured to take the name of the `node_modules` folder as a -parameter. Complexity hurdle #2. - -Furthermore, npm has the ability to "bundle" dependencies by adding -the dep names to the `"bundledDependencies"` list in package.json, -which causes the folder to be included in the package tarball. What -if the author of a module bundles its dependencies, and they use a -different spelling for `node_modules`? npm would have to rename the -folder at publish time, and then be smart enough to unpack it using -your locally configured name. Complexity hurdle #3. - -Furthermore, what happens when you *change* this name? Fine, it's -easy enough the first time, just rename the `node_modules` folders to -`./blergyblerp/` or whatever name you choose. But what about when you -change it again? npm doesn't currently track any state about past -configuration settings, so this would be rather difficult to do -properly. It would have to track every previous value for this -config, and always accept any of them, or else yesterday's install may -be broken tomorrow. Complexity hurdle #5. - -Never going to happen. The folder is named `node_modules`. It is -written indelibly in the Node Way, handed down from the ancient times -of Node 0.3. - ## Should I check my `node_modules` folder into git? Mikeal Rogers answered this question very well: @@ -219,6 +173,96 @@ Git urls can be of the form: The `commit-ish` can be any tag, sha, or branch which can be supplied as an argument to `git checkout`. The default is `master`. +## What is a `module`? + +A module is anything that can be loaded with `require()` in a Node.js +program. The following things are all examples of things that can be +loaded as modules: + +* A folder with a `package.json` file containing a `main` field. +* A folder with an `index.js` file in it. +* A JavaScript file. + +Most npm packages are modules, because they are libraries that you +load with `require`. However, there's no requirement that an npm +package be a module! Some only contain an executable command-line +interface, and don't provide a `main` field for use in Node programs. + +Almost all npm packages (at least, those that are Node programs) +*contain* many modules within them (because every file they load with +`require()` is a module). + +In the context of a Node program, the `module` is also the thing that +was loaded *from* a file. For example, in the following program: + + var req = require('request') + +we might say that "The variable `req` refers to the `request` module". + +## So, why is it the "`node_modules`" folder, but "`package.json`" file? Why not `node_packages` or `module.json`? + +The `package.json` file defines the package. (See "What is a +package?" above.) + +The `node_modules` folder is the place Node.js looks for modules. +(See "What is a module?" above.) + +For example, if you create a file at `node_modules/foo.js` and then +had a program that did `var f = require('foo.js')` then it would load +the module. However, `foo.js` is not a "package" in this case, +because it does not have a package.json. + +Alternatively, if you create a package which does not have an +`index.js` or a `"main"` field in the `package.json` file, then it is +not a module. Even if it's installed in `node_modules`, it can't be +an argument to `require()`. + +## `"node_modules"` is the name of my deity's arch-rival, and a Forbidden Word in my religion. Can I configure npm to use a different folder? + +No. This will never happen. This question comes up sometimes, +because it seems silly from the outside that npm couldn't just be +configured to put stuff somewhere else, and then npm could load them +from there. It's an arbitrary spelling choice, right? What's the big +deal? + +At the time of this writing, the string `'node_modules'` appears 151 +times in 53 separate files in npm and node core (excluding tests and +documentation). + +Some of these references are in node's built-in module loader. Since +npm is not involved **at all** at run-time, node itself would have to +be configured to know where you've decided to stick stuff. Complexity +hurdle #1. Since the Node module system is locked, this cannot be +changed, and is enough to kill this request. But I'll continue, in +deference to your deity's delicate feelings regarding spelling. + +Many of the others are in dependencies that npm uses, which are not +necessarily tightly coupled to npm (in the sense that they do not read +npm's configuration files, etc.) Each of these would have to be +configured to take the name of the `node_modules` folder as a +parameter. Complexity hurdle #2. + +Furthermore, npm has the ability to "bundle" dependencies by adding +the dep names to the `"bundledDependencies"` list in package.json, +which causes the folder to be included in the package tarball. What +if the author of a module bundles its dependencies, and they use a +different spelling for `node_modules`? npm would have to rename the +folder at publish time, and then be smart enough to unpack it using +your locally configured name. Complexity hurdle #3. + +Furthermore, what happens when you *change* this name? Fine, it's +easy enough the first time, just rename the `node_modules` folders to +`./blergyblerp/` or whatever name you choose. But what about when you +change it again? npm doesn't currently track any state about past +configuration settings, so this would be rather difficult to do +properly. It would have to track every previous value for this +config, and always accept any of them, or else yesterday's install may +be broken tomorrow. Complexity hurdle #5. + +Never going to happen. The folder is named `node_modules`. It is +written indelibly in the Node Way, handed down from the ancient times +of Node 0.3. + ## How do I install node with npm? You don't. Try one of these node version managers: @@ -257,11 +301,6 @@ See `npm-link(1)` See `npm-registry(1)`. -## What's up with the insecure channel warnings? - -Until node 0.4.10, there were problems sending big files over HTTPS. That -means that publishes go over HTTP by default in those versions of node. - ## I forgot my password, and can't publish. How do I reset it? Go to . @@ -274,8 +313,9 @@ To check if the registry is down, open up in a web browser. This will also tell you if you are just unable to access the internet for some reason. -If the registry IS down, let me know by emailing or posting an issue. -We'll have someone kick it or something. +If the registry IS down, let me know by emailing or posting +an issue at . We'll have +someone kick it or something. ## Why no namespaces? @@ -295,9 +335,8 @@ There is not sufficient need to impose namespace rules on everyone. ## I have a question or request not addressed here. Where should I put it? -Discuss it on the mailing list, or post an issue. +Post an issue on the github project: -* * ## Why does npm hate me? diff --git a/deps/npm/html/api/bin.html b/deps/npm/html/api/bin.html index 669433d..48f910a 100644 --- a/deps/npm/html/api/bin.html +++ b/deps/npm/html/api/bin.html @@ -19,7 +19,7 @@

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

- +