Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Update npm to 1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 25, 2012
1 parent 27a937b commit d4d45a1
Show file tree
Hide file tree
Showing 133 changed files with 1,862 additions and 509 deletions.
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Expand Up @@ -52,3 +52,5 @@ Gautham Pai <buzypi@gmail.com>
David Trejo <david.daniel.trejo@gmail.com>
Paul Vorbach <paul@vorb.de>
George Ornbo <george@shapeshed.com>
Tim Oxley <secoif@gmail.com>
Tyler Green <tyler.green2@gmail.com>
7 changes: 7 additions & 0 deletions deps/npm/bin/npm-cli.js
Expand Up @@ -49,6 +49,13 @@ if (conf.version) {
return
}

if (conf.versions) {
var v = process.versions
v.npm = npm.version
console.log(v)
return
}

log.info("npm@"+npm.version, "using")
log.info("node@"+process.version, "using")

Expand Down
8 changes: 4 additions & 4 deletions deps/npm/bin/npm.cmd
@@ -1,6 +1,6 @@
:: Created by npm, please don't edit manually.
@IF EXIST "%~dp0"\"node.exe" (
"%~dp0"\"node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
) ELSE (
node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
)
node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
)
6 changes: 6 additions & 0 deletions deps/npm/doc/api/ls.md
Expand Up @@ -21,6 +21,12 @@ It will print out extraneous, missing, and invalid packages.
If the silent parameter is set to true, nothing will be output to the screen,
but the data will still be returned.

Callback is provided an error if one occurred, the full data about which
packages are installed and which dependencies they will receive, and a
"lite" data object which just shows which versions are installed where.
Note that the full data object is a circular structure, so care must be
taken if it is serialized to JSON.

## CONFIGURATION

### long
Expand Down
20 changes: 20 additions & 0 deletions deps/npm/doc/api/shrinkwrap.md
@@ -0,0 +1,20 @@
npm-shrinkwrap(3) -- programmatically generate package shrinkwrap file
====================================================

## SYNOPSIS

npm.commands.shrinkwrap(args, [silent,] callback)

## DESCRIPTION

This acts much the same ways as shrinkwrapping on the command-line.

This command does not take any arguments, but 'args' must be defined.
Beyond that, if any arguments are passed in, npm will politely warn that it
does not take positional arguments.

If the 'silent' parameter is set to true, nothing will be output to the screen,
but the shrinkwrap file will still be written.

Finally, 'callback' is a function that will be called when the shrinkwrap has
been saved.
21 changes: 21 additions & 0 deletions deps/npm/doc/cli/config.md
Expand Up @@ -372,6 +372,17 @@ The value `npm init` should use by default for the package author's email.

The value `npm init` should use by default for the package author's homepage.

### json

* Default: false
* Type: Boolean

Whether or not to output JSON data, rather than the normal output.

This feature is currently experimental, and the output data structures
for many commands is either not implemented in JSON yet, or subject to
change. Only the output from `npm ls --json` is currently valid.

### link

* Default: false
Expand Down Expand Up @@ -682,6 +693,16 @@ If true, output the npm version and exit successfully.

Only relevant when specified explicitly on the command line.

### versions

* Default: false
* Type: boolean

If true, output the npm version as well as node's `process.versions`
hash, and exit successfully.

Only relevant when specified explicitly on the command line.

### viewer

* Default: "man" on Posix, "browser" on Windows
Expand Down
8 changes: 8 additions & 0 deletions deps/npm/doc/cli/index.md
Expand Up @@ -170,6 +170,10 @@ npm-index(1) -- Index of all npm documentation

The semantic versioner for npm

## npm-shrinkwrap(1)

Lock down dependency versions

## npm-star(1)

Mark your favorite packages
Expand Down Expand Up @@ -323,6 +327,10 @@ npm-index(1) -- Index of all npm documentation

Search for packages

## npm-shrinkwrap(3)

programmatically generate package shrinkwrap file

## npm-start(3)

Start a package
Expand Down
5 changes: 4 additions & 1 deletion deps/npm/doc/cli/install.md
Expand Up @@ -14,7 +14,9 @@ npm-install(1) -- Install a package

## DESCRIPTION

This command installs a package, and any packages that it depends on.
This command installs a package, and any packages that it depends on. If the
package has a shrinkwrap file, the installation of dependencies will be driven
by that. See npm-shrinkwrap(1).

A `package` is:

Expand Down Expand Up @@ -199,3 +201,4 @@ affects a real use-case, it will be investigated.
* npm-folders(1)
* npm-tag(1)
* npm-rm(1)
* npm-shrinkwrap(1)
7 changes: 7 additions & 0 deletions deps/npm/doc/cli/list.md
Expand Up @@ -22,6 +22,13 @@ When run as `ll` or `la`, it shows extended information by default.

## CONFIGURATION

### json

* Default: false
* Type: Boolean

Show information in JSON format.

### long

* Default: false
Expand Down
171 changes: 171 additions & 0 deletions deps/npm/doc/cli/shrinkwrap.md
@@ -0,0 +1,171 @@
npm-shrinkwrap(1) -- Lock down dependency versions
=====================================================

## SYNOPSIS

npm shrinkwrap

## DESCRIPTION

This command locks down the versions of a package's dependencies so that you can
control exactly which versions of each dependency will be used when your package
is installed.

By default, "npm install" recursively installs the target's dependencies (as
specified in package.json), choosing the latest available version that satisfies
the dependency's semver pattern. In some situations, particularly when shipping
software where each change is tightly managed, it's desirable to fully specify
each version of each dependency recursively so that subsequent builds and
deploys do not inadvertently pick up newer versions of a dependency that satisfy
the semver pattern. Specifying specific semver patterns in each dependency's
package.json would facilitate this, but that's not always possible or desirable,
as when another author owns the npm package. It's also possible to check
dependencies directly into source control, but that may be undesirable for other
reasons.

As an example, consider package A:

{
"name": "A",
"version": "0.1.0",
"dependencies": {
"B": "<0.1.0"
}
}

package B:

{
"name": "B",
"version": "0.0.1",
"dependencies": {
"C": "<0.1.0"
}
}

and package C:

{
"name": "C,
"version": "0.0.1"
}

If these are the only versions of A, B, and C available in the registry, then
a normal "npm install A" will install:

A@0.1.0
`-- B@0.0.1
`-- C@0.0.1

However, if B@0.0.2 is published, then a fresh "npm install A" will install:

A@0.1.0
`-- B@0.0.2
`-- C@0.0.1

assuming the new version did not modify B's dependencies. Of course, the new
version of B could include a new version of C and any number of new
dependencies. If such changes are undesirable, the author of A could specify a
dependency on B@0.0.1. However, if A's author and B's author are not the same
person, there's no way for A's author to say that he or she does not want to
pull in newly published versions of C when B hasn't changed at all.

In this case, A's author can run

npm shrinkwrap

This generates npm-shrinkwrap.json, which will look something like this:

{
"name": "A",
"version": "0.1.0",
"dependencies": {
"B": {
"version": "0.0.1",
"dependencies": {
"C": {
"version": "0.1.0"
}
}
}
}
}

The shrinkwrap command has locked down the dependencies based on what's
currently installed in node_modules. When "npm install" installs a package with
a npm-shrinkwrap.json file in the package root, the shrinkwrap file (rather than
package.json files) completely drives the installation of that package and all
of its dependencies (recursively). So now the author publishes A@0.1.0, and
subsequent installs of this package will use B@0.0.1 and C@0.1.0, regardless the
dependencies and versions listed in A's, B's, and C's package.json files.


### Using shrinkwrapped packages

Using a shrinkwrapped package is no different than using any other package: you
can "npm install" it by hand, or add a dependency to your package.json file and
"npm install" it.

### Building shrinkwrapped packages

To shrinkwrap an existing package:

1. Run "npm install" in the package root to install the current versions of all
dependencies.
2. Validate that the package works as expected with these versions.
3. Run "npm shrinkwrap", add npm-shrinkwrap.json to git, and publish your
package.

To add or update a dependency in a shrinkwrapped package:

1. Run "npm install" in the package root to install the current versions of all
dependencies.
2. Add or update dependencies. "npm install" each new or updated package
individually and then update package.json. Note that they must be
explicitly named in order to be installed: running `npm install` with
no arguments will merely reproduce the existing shrinkwrap.
3. Validate that the package works as expected with the new dependencies.
4. Run "npm shrinkwrap", commit the new npm-shrinkwrap.json, and publish your
package.

You can use npm-outdated(1) to view dependencies with newer versions available.

### Other Notes

Since "npm shrinkwrap" uses the locally installed packages to construct the
shrinkwrap file, devDependencies will be included if and only if you've
installed them already when you make the shrinkwrap.

A shrinkwrap file must be consistent with the package's package.json file. "npm
shrinkwrap" will fail if required dependencies are not already installed, since
that would result in a shrinkwrap that wouldn't actually work. Similarly, the
command will fail if there are extraneous packages (not referenced by
package.json), since that would indicate that package.json is not correct.

If shrinkwrapped package A depends on shrinkwrapped package B, B's shrinkwrap
will not be used as part of the installation of A. However, because A's
shrinkwrap is constructed from a valid installation of B and recursively
specifies all dependencies, the contents of B's shrinkwrap will implicitly be
included in A's shrinkwrap.

### Caveats

Shrinkwrap files only lock down package versions, not actual package contents.
While discouraged, a package author can republish an existing version of a
package, causing shrinkwrapped packages using that version to pick up different
code than they were before. If you want to avoid any risk that a byzantine
author replaces a package you're using with code that breaks your application,
you could modify the shrinkwrap file to use git URL references rather than
version numbers so that npm always fetches all packages from git.

If you wish to lock down the specific bytes included in a package, for
example to have 100% confidence in being able to reproduce a deployment
or build, then you ought to check your dependencies into source control,
or pursue some other mechanism that can verify contents rather than
versions.

## SEE ALSO

* npm-install(1)
* npm-json(1)
* npm-list(1)
2 changes: 1 addition & 1 deletion deps/npm/html/api/bin.html
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.1.1</p>
<p id="footer">bin &mdash; npm@1.1.2</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/bugs.html
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.1.1</p>
<p id="footer">bugs &mdash; npm@1.1.2</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/commands.html
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.1.1</p>
<p id="footer">commands &mdash; npm@1.1.2</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/config.html
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.1.1</p>
<p id="footer">config &mdash; npm@1.1.2</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/deprecate.html
Expand Up @@ -30,7 +30,7 @@ <h2 id="SEE-ALSO">SEE ALSO</h2>

<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>
</div>
<p id="footer">deprecate &mdash; npm@1.1.1</p>
<p id="footer">deprecate &mdash; npm@1.1.2</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/docs.html
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">docs &mdash; npm@1.1.1</p>
<p id="footer">docs &mdash; npm@1.1.2</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/edit.html
Expand Up @@ -30,7 +30,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>Since this command opens an editor in a new process, be careful about where
and how this is used.</p>
</div>
<p id="footer">edit &mdash; npm@1.1.1</p>
<p id="footer">edit &mdash; npm@1.1.2</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/html/api/explore.html
Expand Up @@ -24,7 +24,7 @@ <h2 id="DESCRIPTION">DESCRIPTION</h2>

<p>The first element in the 'args' 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>
</div>
<p id="footer">explore &mdash; npm@1.1.1</p>
<p id="footer">explore &mdash; npm@1.1.2</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
Expand Down

0 comments on commit d4d45a1

Please sign in to comment.