@@ -14,6 +14,17 @@ Much more info available via `npm help` once it's installed.
14
14
To install an old ** and unsupported** version of npm that works on node 0.3
15
15
and prior, clone the git repo and dig through the old tags and branches.
16
16
17
+ ** npm is configured to use npm, Inc.'s public package registry at
18
+ < https://registry.npmjs.org > by default.**
19
+
20
+ You can configure npm to use any compatible registry you
21
+ like, and even run your own registry. Check out the [ doc on
22
+ registries] ( https://docs.npmjs.com/misc/registry ) .
23
+
24
+ Use of someone else's registry may be governed by terms of use. The
25
+ terms of use for the default public registry are available at
26
+ < https://www.npmjs.com > .
27
+
17
28
## Super Easy Install
18
29
19
30
npm is bundled with [ node] ( http://nodejs.org/download/ ) .
@@ -127,52 +138,6 @@ must remove them yourself manually if you want them gone. Note that
127
138
this means that future npm installs will not remember the settings that
128
139
you have chosen.
129
140
130
- ## Using npm Programmatically
131
-
132
- Although npm can be used programmatically, its API is meant for use by the CLI
133
- * only* , and no guarantees are made regarding its fitness for any other purpose.
134
- If you want to use npm to reliably perform some task, the safest thing to do is
135
- to invoke the desired ` npm ` command with appropriate arguments.
136
-
137
- The semantic version of npm refers to the CLI itself, rather than the
138
- underlying API. _ The internal API is not guaranteed to remain stable even when
139
- npm's version indicates no breaking changes have been made according to
140
- semver._
141
-
142
- If you _ still_ would like to use npm programmatically, it's _ possible_ . The API
143
- isn't very well documented, but it _ is_ rather simple.
144
-
145
- Eventually, npm will be just a thin CLI wrapper around the modules that it
146
- depends on, but for now, there are some things that only the CLI can do. You
147
- should try using one of npm's dependencies first, and only use the API if what
148
- you're trying to do is only supported by npm itself.
149
-
150
- ``` javascript
151
- var npm = require (" npm" )
152
- npm .load (myConfigObject, function (er ) {
153
- if (er) return handlError (er)
154
- npm .commands .install ([" some" , " args" ], function (er , data ) {
155
- if (er) return commandFailed (er)
156
- // command succeeded, and data might have some info
157
- })
158
- npm .registry .log .on (" log" , function (message ) { ... . })
159
- })
160
- ```
161
-
162
- The ` load ` function takes an object hash of the command-line configs.
163
- The various ` npm.commands.<cmd> ` functions take an ** array** of
164
- positional argument ** strings** . The last argument to any
165
- ` npm.commands.<cmd> ` function is a callback. Some commands take other
166
- optional arguments. Read the source.
167
-
168
- You cannot set configs individually for any single npm function at this
169
- time. Since ` npm ` is a singleton, any call to ` npm.config.set ` will
170
- change the value for * all* npm commands in that process.
171
-
172
- See ` ./bin/npm-cli.js ` for an example of pulling config values off of the
173
- command line arguments using nopt. You may also want to check out `npm
174
- help config` to learn about all the options you can set there.
175
-
176
141
## More Docs
177
142
178
143
Check out the [ docs] ( https://docs.npmjs.com/ ) ,
@@ -183,47 +148,6 @@ You can use the `npm help` command to read any of them.
183
148
If you're a developer, and you want to use npm to publish your program,
184
149
you should [ read this] ( https://docs.npmjs.com/misc/developers )
185
150
186
- ## Legal Stuff
187
-
188
- "npm" and "The npm Registry" are owned by npm, Inc.
189
- All rights reserved. See the included LICENSE file for more details.
190
-
191
- "Node.js" and "node" are trademarks owned by Joyent, Inc.
192
-
193
- Modules published on the npm registry are not officially endorsed by
194
- npm, Inc. or the Node.js project.
195
-
196
- Data published to the npm registry is not part of npm itself, and is
197
- the sole property of the publisher. While every effort is made to
198
- ensure accountability, there is absolutely no guarantee, warranty, or
199
- assertion expressed or implied as to the quality, fitness for a
200
- specific purpose, or lack of malice in any given npm package.
201
-
202
- If you have a complaint about a package in the public npm registry,
203
- and cannot [ resolve it with the package
204
- owner] ( https://docs.npmjs.com/misc/disputes ) , please email
205
- < [email protected] > and explain the situation.
206
-
207
- Any data published to The npm Registry (including user account
208
- information) may be removed or modified at the sole discretion of the
209
- npm server administrators.
210
-
211
- ### In plainer english
212
-
213
- npm is the property of npm, Inc.
214
-
215
- If you publish something, it's yours, and you are solely accountable
216
- for it.
217
-
218
- If other people publish something, it's theirs.
219
-
220
- Users can publish Bad Stuff. It will be removed promptly if reported.
221
- But there is no vetting process for published modules, and you use
222
- them at your own risk. Please inspect the source.
223
-
224
- If you publish Bad Stuff, we may delete it from the registry, or even
225
- ban your account in extreme cases. So don't do that.
226
-
227
151
## BUGS
228
152
229
153
When you find issues, please report them:
0 commit comments