Skip to content

Commit

Permalink
Close npm#882 Add docs in a few places re: global
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 8, 2011
1 parent 1e633cc commit 1a4fd71
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 4 deletions.
6 changes: 5 additions & 1 deletion doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ This command installs a package, and any packages that it depends on.
* npm install (in package directory):
Install the dependencies in the local node_modules folder.

In global mode, it is the same as `npm install $PWD`
In global mode (ie, with `-g` or `--global` appended to the command),
it is the same as `npm install $PWD`

* npm install `<tarball file>`:
Install a package that is sitting on the filesystem. Note: if you just want
Expand Down Expand Up @@ -89,6 +90,9 @@ local copy exists on disk.

npm install sax --force

The `--global` argument will cause npm to install the package globally
rather than locally. See `npm help global`.

## SEE ALSO

* npm-build(1)
Expand Down
8 changes: 8 additions & 0 deletions doc/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ Show extended information.
* Type: Boolean

Show parseable output instead of tree view.

### global

* Default: false
* Type: Boolean

List packages in the global install prefix instead of in the current
project.
17 changes: 17 additions & 0 deletions doc/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ Use `npm install blerg` to install the latest version of "blerg". Check out
Use the `npm search` command to show everything that's available.
Use `npm ls` to show everything you've installed.

## DIRECTORIES

See `npm help folders` to learn about where npm puts stuff.

In particular, npm has two modes of operation:

* global mode:
npm installs packages into the install prefix at
`prefix/lib/node_modules` and bins are installed in `prefix/bin`.
* local mode:
npm installs packages into the current project directory, which
defaults to the current working directory. Packages are installed to
`./node_modules`, and bins are installed to `./node_modules/.bin`.

Local mode is the default. Use `--global` or `-g` on any command to
operate in global mode instead.

## DEVELOPER USAGE

If you're using npm to develop and publish your code, check out the
Expand Down
14 changes: 14 additions & 0 deletions man1/find.1
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,17 @@ Type: Boolean
.
.P
Show parseable output instead of tree view\.
.
.SS "global"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
List packages in the global install prefix instead of in the current
project\.
9 changes: 7 additions & 2 deletions man1/install.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
.TH "NPM\-INSTALL" "1" "March 2011" "" ""
.TH "NPM\-INSTALL" "1" "May 2011" "" ""
.
.SH "NAME"
\fBnpm-install\fR \-\- install a package
Expand All @@ -28,7 +28,8 @@ npm install (in package directory):
Install the dependencies in the local node_modules folder\.
.
.IP
In global mode, it is the same as \fBnpm install $PWD\fR
In global mode (ie, with \fB\-g\fR or \fB\-\-global\fR appended to the command),
it is the same as \fBnpm install $PWD\fR
.
.IP "\(bu" 4
npm install \fB<tarball file>\fR:
Expand Down Expand Up @@ -136,6 +137,10 @@ npm install sax \-\-force
.
.IP "" 0
.
.P
The \fB\-\-global\fR argument will cause npm to install the package globally
rather than locally\. See \fBnpm help global\fR\|\.
.
.SH "SEE ALSO"
.
.IP "\(bu" 4
Expand Down
14 changes: 14 additions & 0 deletions man1/list.1
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,17 @@ Type: Boolean
.
.P
Show parseable output instead of tree view\.
.
.SS "global"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
List packages in the global install prefix instead of in the current
project\.
14 changes: 14 additions & 0 deletions man1/ls.1
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,17 @@ Type: Boolean
.
.P
Show parseable output instead of tree view\.
.
.SS "global"
.
.IP "\(bu" 4
Default: false
.
.IP "\(bu" 4
Type: Boolean
.
.IP "" 0
.
.P
List packages in the global install prefix instead of in the current
project\.
27 changes: 26 additions & 1 deletion man1/npm.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" Generated with Ronnjs/v0.1
.\" http://github.com/kapouer/ronnjs/
.
.TH "NPM" "1" "April 2011" "" ""
.TH "NPM" "1" "May 2011" "" ""
.
.SH "NAME"
\fBnpm\fR \-\- node package manager
Expand Down Expand Up @@ -36,6 +36,31 @@ Use \fBnpm install blerg\fR to install the latest version of "blerg"\. Check ou
Use the \fBnpm search\fR command to show everything that\'s available\.
Use \fBnpm ls\fR to show everything you\'ve installed\.
.
.SH "DIRECTORIES"
See \fBnpm help folders\fR to learn about where npm puts stuff\.
.
.P
In particular, npm has two modes of operation:
.
.IP "\(bu" 4
global mode:
.
.br
npm installs packages into the install prefix at \fBprefix/lib/node_modules\fR and bins are installed in \fBprefix/bin\fR\|\.
.
.IP "\(bu" 4
local mode:
.
.br
npm installs packages into the current project directory, which
defaults to the current working directory\. Packages are installed to \fB\|\./node_modules\fR, and bins are installed to \fB\|\./node_modules/\.bin\fR\|\.
.
.IP "" 0
.
.P
Local mode is the default\. Use \fB\-\-global\fR or \fB\-g\fR on any command to
operate in global mode instead\.
.
.SH "DEVELOPER USAGE"
If you\'re using npm to develop and publish your code, check out the
following help topics:
Expand Down

0 comments on commit 1a4fd71

Please sign in to comment.