Skip to content

Commit 388a734

Browse files
committed
docs(npm): update npm command docs
These are the base docs for the npm cli itself that populates `man npm`, Mostly grammar fixes, some additions and clarifications in places, new links to some appropriate other docs
1 parent eb4f069 commit 388a734

File tree

1 file changed

+58
-44
lines changed

1 file changed

+58
-44
lines changed

docs/content/commands/npm.md

Lines changed: 58 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,42 @@ npm is the package manager for the Node JavaScript platform. It puts
2020
modules in place so that node can find them, and manages dependency
2121
conflicts intelligently.
2222

23-
It is extremely configurable to support a wide variety of use cases.
24-
Most commonly, it is used to publish, discover, install, and develop node
23+
It is extremely configurable to support a variety of use cases. Most
24+
commonly, you use it to publish, discover, install, and develop node
2525
programs.
2626

2727
Run `npm help` to get a list of available commands.
2828

2929
### Important
3030

31-
npm is configured to use npm, Inc.'s public registry at
31+
npm comes preconfigured to use npm's public registry at
3232
https://registry.npmjs.org by default. Use of the npm public registry is
33-
subject to terms of use available at https://www.npmjs.com/policies/terms.
33+
subject to terms of use available at
34+
https://www.npmjs.com/policies/terms.
3435

35-
You can configure npm to use any compatible registry you like, and even run
36-
your own registry. Use of someone else's registry may be governed by their
37-
terms of use.
36+
You can configure npm to use any compatible registry you like, and even
37+
run your own registry. Use of someone else's registry is governed by
38+
their terms of use.
3839

3940
### Introduction
4041

4142
You probably got npm because you want to install stuff.
4243

43-
Use `npm install blerg` to install the latest version of "blerg". Check out
44-
[`npm install`](/commands/npm-install) for more info. It can do a lot of stuff.
44+
The very first thing you will most likely want to run in any node
45+
program is `npm install` to install its dependencies.
4546

46-
Use the `npm search` command to show everything that's available.
47-
Use `npm ls` to show everything you've installed.
47+
You can also run `npm install blerg` to install the latest version of
48+
"blerg". Check out [`npm install`](/commands/npm-install) for more
49+
info. It can do a lot of stuff.
50+
51+
Use the `npm search` command to show everything that's available in the
52+
public registry. Use `npm ls` to show everything you've installed.
4853

4954
### Dependencies
5055

51-
If a package references to another package with a git URL, npm depends
52-
on a preinstalled git.
56+
In addition to the default behavior of installing from the public
57+
registry, if a package references to another package with a git URL, npm
58+
will on a pre-installed git.
5359

5460
If one of the packages npm tries to install is a native node module and
5561
requires compiling of C++ Code, npm will use
@@ -64,41 +70,44 @@ the [node-gyp Wiki](https://github.com/nodejs/node-gyp/wiki).
6470

6571
### Directories
6672

67-
See [`folders`](/configuring-npm/folders) to learn about where npm puts stuff.
73+
See [`folders`](/configuring-npm/folders) to learn about where npm puts
74+
stuff.
6875

6976
In particular, npm has two modes of operation:
7077

71-
* global mode:
72-
npm installs packages into the install prefix at
73-
`prefix/lib/node_modules` and bins are installed in `prefix/bin`.
7478
* local mode:
7579
npm installs packages into the current project directory, which
76-
defaults to the current working directory. Packages are installed to
77-
`./node_modules`, and bins are installed to `./node_modules/.bin`.
80+
defaults to the current working directory. packages install to
81+
`./node_modules`, and bins to `./node_modules/.bin`.
82+
* global mode:
83+
npm installs packages into the install prefix at
84+
`prefix/lib/node_modules` and bins to `prefix/bin`.
7885

7986
Local mode is the default. Use `-g` or `--global` on any command to
80-
operate in global mode instead.
87+
run in global mode instead.
8188

8289
### Developer Usage
8390

8491
If you're using npm to develop and publish your code, check out the
8592
following help topics:
8693

8794
* json:
88-
Make a package.json file. See [`package.json`](/configuring-npm/package-json).
95+
Make a package.json file. See
96+
[`package.json`](/configuring-npm/package-json).
8997
* link:
90-
For linking your current working code into Node's path, so that you
91-
don't have to reinstall every time you make a change. Use
92-
`npm link` to do this.
98+
Links your current working code into Node's path, so that you don't
99+
have to reinstall every time you make a change. Use [`npm
100+
link`](/commands/npm-link) to do this.
93101
* install:
94-
It's a good idea to install things if you don't need the symbolic link.
95-
Especially, installing other peoples code from the registry is done via
96-
`npm install`
102+
It's a good idea to install things if you don't need the symbolic
103+
link. Especially, installing other peoples code from the registry is
104+
done via [`npm install`](/commands/npm-install)
97105
* adduser:
98-
Create an account or log in. Credentials are stored in the
99-
user config file.
106+
Create an account or log in. When you do this, npm will store
107+
credentials in the user config file config file.
100108
* publish:
101-
Use the `npm publish` command to upload your code to the registry.
109+
Use the [`npm publish`](/commands/npm-publish`) command to upload your
110+
code to the registry.
102111

103112
#### Configuration
104113

@@ -108,20 +117,20 @@ npm is extremely configurable. It reads its configuration options from
108117
* Command line switches:
109118
Set a config with `--key val`. All keys take a value, even if they
110119
are booleans (the config parser doesn't know what the options are at
111-
the time of parsing). If no value is provided, then the option is set
112-
to boolean `true`.
120+
the time of parsing). If you do not provide a value (`--key`) then
121+
the option is set to boolean `true`.
113122
* Environment Variables:
114123
Set any config by prefixing the name in an environment variable with
115124
`npm_config_`. For example, `export npm_config_key=val`.
116125
* User Configs:
117126
The file at $HOME/.npmrc is an ini-formatted list of configs. If
118127
present, it is parsed. If the `userconfig` option is set in the cli
119-
or env, then that will be used instead.
128+
or env, that file will be used instead.
120129
* Global Configs:
121-
The file found at ../etc/npmrc (from the node executable, by default
122-
this resolves to /usr/local/etc/npmrc) will be parsed if it is found.
123-
If the `globalconfig` option is set in the cli, env, or user config,
124-
then that file is parsed instead.
130+
The file found at ./etc/npmrc (relative to the global prefix will be
131+
parsed if it is found. See [`npm prefix`](/commands/npm-prefix) for
132+
more info on the global prefix. If the `globalconfig` option is set
133+
in the cli, env, or user config, then that file is parsed instead.
125134
* Defaults:
126135
npm's default configuration options are defined in
127136
lib/utils/config-defs.js. These must not be changed.
@@ -132,15 +141,17 @@ See [`config`](/using-npm/config) for much much more information.
132141

133142
Patches welcome!
134143

135-
If you would like to contribute, but don't know what to work on, read
136-
the [contributing guidelines](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md)
137-
and check the issues list.
144+
If you would like to help, but don't know what to work on, read the
145+
[contributing
146+
guidelines](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) and
147+
check the issues list.
138148

139149
### Bugs
140150

141-
When you find issues, please report them: <https://github.com/npm/cli/issues>
151+
When you find issues, please report them:
152+
<https://github.com/npm/cli/issues>
142153

143-
Be sure to follow the template and bug reporting guidelines.
154+
Please be sure to follow the template and bug reporting guidelines.
144155

145156
### Feature Requests
146157

@@ -153,8 +164,11 @@ Or suggest formal RFC proposals:
153164
* <https://github.com/npm/rfcs>
154165

155166
### See Also
167+
156168
* [npm help](/commands/npm-help)
157169
* [package.json](/configuring-npm/package-json)
158-
* [npm install](/commands/npm-install)
159-
* [npm config](/commands/npm-config)
160170
* [npmrc](/configuring-npm/npmrc)
171+
* [npm config](/commands/npm-config)
172+
* [npm install](/commands/npm-install)
173+
* [npm prefix](/commands/npm-prefix)
174+
* [npm publish](/commands/npm-publish)

0 commit comments

Comments
 (0)