Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 535 lines (534 sloc) 13.654 kb
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
1 .\" Generated with Ronnjs/v0.1
2 .\" http://github.com/kapouer/ronnjs/
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
3 .
648c9ff isaacs Doc json field enhancements
isaacs authored
4 .TH "NPM\-JSON" "1" "December 2010" "" ""
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
5 .
6 .SH "NAME"
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
7 \fBnpm-json\fR \-\- Specifics of npm\'s package\.json handling
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
8 .
9 .SH "DESCRIPTION"
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
10 npm aims to implement the commonjs Packages \fIhttp://wiki\.commonjs\.org/wiki/Packages/1\.0\fR spec\. However, some
11 adjustments have been made, which may eventually be unmade, but hopefully will
12 be incorporated into the spec\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
13 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
14 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
15 This document is all you need to know about what\'s required in your package\.json
16 file\.
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
17 .
c1cc130 isaacs make doc
isaacs authored
18 .P
19 A lot of the behavior described in this document is affected by the config
20 settings described in \fBnpm help config\fR\|\.
21 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
22 .SH "name"
23 The \fImost\fR important things in your package\.json are the name and version fields\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
24 .
25 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
26 The name is what your thing is called\. Some tips:
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
27 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
28 .IP "\(bu" 4
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
29 Don\'t put "js" or "node" in the name\. It\'s assumed that it\'s js, since you\'re
30 writing a package\.json file, and you can specify the engine using the "engines"
31 field\. (See below\.)
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
32 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
33 .IP "\(bu" 4
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
34 The name ends up being part of a URL, an argument on the command line, and a
35 folder name\. So, don\'t use characters that are annoying in those contexts, like
36 funny UTF things or parentheses or slashes, or else it\'ll break\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
37 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
38 .IP "\(bu" 4
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
39 The name will probably be passed as an argument to require(), so it should
40 be something short, but also reasonably descriptive\.
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
41 .
42 .IP "\(bu" 4
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
43 You may want to check the npm registry to see if there\'s something by that name
44 already, before you get too attached to it\. http://registry\.npmjs\.org/
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
45 .
46 .IP "" 0
47 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
48 .SH "version"
49 The \fImost\fR important things in your package\.json are the name and version fields\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
50 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
51 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
52 Version must be semver \fIhttp://semver\.org\fR\-compliant\. npm assumes that you\'ve
53 read the semver page, and that you comply with it\. Here\'s how it deviates from
54 what\'s on semver\.org:
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
55 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
56 .IP "\(bu" 4
57 Versions can start with "v"
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
58 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
59 .IP "\(bu" 4
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
60 A numeric item separated from the main three\-number version by a hyphen
61 will be interpreted as a "build" number, and will \fIincrease\fR the version\.
62 But, if the tag is not a number separated by a hyphen, then it\'s treated
63 as a pre\-release tag, and is \fIless than\fR the version without a tag\.
64 So, 0\.1\.2\-7 > 0\.1\.2\-6 > 0\.1\.2 > 0\.1\.2beta
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
65 .
66 .IP "" 0
67 .
68 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
69 This is a little bit confusing to explain, but matches what you see in practice
70 when people create tags in git like "v1\.2\.3" and then do "git describe" to generate
71 a patch version\. (This is how node\'s versions are generated, and has driven this
72 design\.)
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
73 .
e4f1f57 isaacs move some stuff around, add various meta things that are nice
isaacs authored
74 .SH "description"
648c9ff isaacs Doc json field enhancements
isaacs authored
75 Put a description in it\. It\'s a string\. This helps people discover your
76 package, as it\'s listed in \fBnpm ls\fR\|\.
77 .
78 .SH "keywords"
79 Put keywords in it\. It\'s an array of strings\. This helps people
80 discover your package as it\'s listed in \fBnpm ls\fR\|\.
e4f1f57 isaacs move some stuff around, add various meta things that are nice
isaacs authored
81 .
82 .SH "homepage"
83 The url to the project homepage\.
84 .
648c9ff isaacs Doc json field enhancements
isaacs authored
85 .P
86 \fBNOTE\fR: This is \fInot\fR the same as "url"\. If you put a "url" field,
87 then the registry will think it\'s a redirection to your package that has
88 been published somewhere else, and spit at you\.
89 .
90 .P
91 Literally\. Spit\. I\'m so not kidding\.
92 .
085fbd4 isaacs Update json documentation
isaacs authored
93 .SH "people fields: author, contributors"
e4f1f57 isaacs move some stuff around, add various meta things that are nice
isaacs authored
94 The "author" is one person\. "contributors" is an array of people\. A "person"
95 is an object with a "name" field and optionally "url" and "email", like this:
96 .
97 .IP "" 4
98 .
99 .nf
100 { "name" : "Barney Rubble"
101 , "email" : "b@rubble\.com"
102 , "url" : "http://barnyrubble\.tumblr\.com/"
103 }
104 .
105 .fi
106 .
107 .IP "" 0
108 .
109 .P
110 Or you can shorten that all into a single string, and npm will parse it for you:
111 .
112 .IP "" 4
113 .
114 .nf
115 "Barney Rubble <b@rubble\.com> (http://barnyrubble\.tumblr\.com/)
116 .
117 .fi
118 .
119 .IP "" 0
120 .
121 .P
122 Both email and url are optional either way\.
123 .
124 .P
125 npm also sets a top\-level "maintainers" field with your npm user info\.
126 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
127 .SH "main"
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
128 The main field is a module ID that is the primary entry point to your program\.
129 That is, if your package is named \fBfoo\fR, and a user installs it, and then does \fBrequire("foo")\fR, then your main module\'s exports object will be returned\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
130 .
131 .P
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
132 This should be a module ID relative to the root of your package folder\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
133 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
134 .P
e4f1f57 isaacs move some stuff around, add various meta things that are nice
isaacs authored
135 For most modules, it makes the most sense to have a main script and often not
136 much else\.
137 .
138 .SH "bin"
139 A lot of packages have one or more executable files that they\'d like to
140 install into the PATH\. npm makes this pretty easy (in fact, it uses this
141 feature to install the "npm" executable\.)
142 .
143 .P
144 To use this, supply a \fBbin\fR field in your package\.json which is a map of
145 command name to local file name\. On install, npm will link that file into
146 place right next to wherever node is installed\. (Presumably, this is in your
147 PATH, and defaults to \fB/usr/local/bin\fR\|\.) On activation, the versioned file
148 will get linked to the main filename (just like how the main\.js stuff works,
149 but with an executable in the PATH\.)
150 .
151 .P
152 For example, npm has this:
153 .
154 .IP "" 4
155 .
156 .nf
157 { "bin" : { "npm" : "\./cli\.js" } }
158 .
159 .fi
160 .
161 .IP "" 0
162 .
163 .P
164 So, when you install npm, it\'ll create a symlink from the \fBcli\.js\fR script to \fB/usr/local/bin/npm\-version\fR\|\. Then, when you activate that version, it\'ll
165 create a symlink from \fB/usr/local/bin/npm\-version\fR to \fB/usr/local/bin/npm\fR\|\.
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
166 .
085fbd4 isaacs Update json documentation
isaacs authored
167 .P
19206ee Whyme Lyu Document require.main doesn't work as usual in bin file.
5long authored
168 Notice that if the executable file is interpreted by node (i\.e\., specifying
169 node in the shebang line), npm actually installs a shim instead of symlinking
170 it, which causes expressions \fBrequire\.main === module\fR and \fBmodule\.id === "\."\fR
171 evaluate to \fBfalse\fR within the file\. This seems unable to be resolved until
172 node provides a "flexible \fBrequire()\fR"\.
173 .
174 .P
085fbd4 isaacs Update json documentation
isaacs authored
175 Shortcut: If you have a single executable, and its name is already what you
176 want it to be, then you can just supply it as a string\. For example:
177 .
178 .IP "" 4
179 .
180 .nf
181 { "bin" : "\./path/to/program" }
182 .
183 .fi
184 .
185 .IP "" 0
186 .
187 .P
188 would be the same as this:
189 .
190 .IP "" 4
191 .
192 .nf
193 { "bin" : { "program" : "\./path/to/program" } }
194 .
195 .fi
196 .
197 .IP "" 0
198 .
c5288e3 isaacs make doc
isaacs authored
199 .SH "modules"
200 The "modules" member exposes CommonJS modules in the package\. So, if you had a
201 package named \fBfoo\fR, and the package\.json contains \fB"modules":{"bar":"\./lib/baz"}\fR,
202 and there was a file called \fB\|\./lib/baz\.js\fR, then require("foo/bar") would include
203 the module defined in \fB\|\./lib/baz\.js\fR\|\.
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
204 .
205 .P
4792d40 isaacs Put directories.lib info back in the doc, and document the repository se...
isaacs authored
206 Subfolders are supported, so you can do this:
207 .
208 .IP "" 4
209 .
210 .nf
211 { "name" : "foo"
212 , "modules" :
213 { "bar/baz" : "\./lib/bar/baz"
214 , "quux" : "\./quux"
215 }
216 }
217 .
218 .fi
219 .
220 .IP "" 0
221 .
222 .P
223 And then, doing \fBrequire("foo/bar/baz")\fR would return the module at \fB\|\./lib/bar/baz\fR
085fbd4 isaacs Update json documentation
isaacs authored
224 in the foo package\. Doing \fBrequire("foo/quux")\fR would return the module at \fB\|\./quux\fR in the foo package\.
4792d40 isaacs Put directories.lib info back in the doc, and document the repository se...
isaacs authored
225 .
226 .P
c5288e3 isaacs make doc
isaacs authored
227 Just like the \fBmain\fR script, the modules linked in this fashion will have their
4792d40 isaacs Put directories.lib info back in the doc, and document the repository se...
isaacs authored
228 dependencies and paths set up properly by npm\. (In fact, "main" is just sugar
229 around setting a module named "index"\.)
230 .
c1cc130 isaacs make doc
isaacs authored
231 .SH "man"
232 Specify either a single file or an array of filenames to put in place for the \fBman\fR program to find\.
233 .
234 .P
235 If only a single file is provided, then it\'s installed such that it is the
236 result from \fBman <pkgname>\fR, regardless of its actual filename\. For example:
237 .
238 .IP "" 4
239 .
240 .nf
241 { "name" : "foo"
242 , "man" : "\./man/doc\.1"
243 }
244 .
245 .fi
246 .
247 .IP "" 0
248 .
249 .P
250 would link the \fB\|\./man/doc\.1\fR file in such that it is the target for \fBman foo\fR
251 .
252 .P
253 If the filename doesn\'t start with the package name, then it\'s prefixed\.
254 So, this:
255 .
256 .IP "" 4
257 .
258 .nf
259 { "name" : "foo"
260 , "man" : [ "\./man/foo\.1", "\./man/bar\.1" ]
261 }
262 .
263 .fi
264 .
265 .IP "" 0
266 .
267 .P
268 will create files to do \fBman foo\fR and \fBman foo\-bar\fR\|\.
269 .
270 .P
271 Man files must end with a number, and optionally a \fB\|\.gz\fR suffix if they are
272 compressed\. The number dictates which man section the file is installed into\.
273 .
274 .IP "" 4
275 .
276 .nf
277 { "name" : "foo"
278 , "man" : [ "\./man/foo\.1", "\./man/foo\.2" ]
279 }
280 .
281 .fi
282 .
283 .IP "" 0
284 .
285 .P
286 will create entries for \fBman foo\fR and \fBman 2 foo\fR
287 .
4792d40 isaacs Put directories.lib info back in the doc, and document the repository se...
isaacs authored
288 .SH "directories"
289 The CommonJS Packages \fIhttp://wiki\.commonjs\.org/wiki/Packages/1\.0\fR spec details a
290 few ways that you can indicate the structure of your package using a \fBdirectories\fR
291 hash\. If you look at npm\'s package\.json \fIhttp://registry\.npmjs\.org/npm/latest\fR,
292 you\'ll see that it has directories for doc, lib, and man\.
293 .
294 .P
295 In the future, this information may be used in other creative ways\.
296 .
297 .SS "directories\.lib"
e4f1f57 isaacs move some stuff around, add various meta things that are nice
isaacs authored
298 If you specify a "lib" directory, and do not supply a modules hash, then the lib
299 folder will be walked and any \fI\|\.js or \fR\|\.node files found will be exposed as a
c1cc130 isaacs make doc
isaacs authored
300 default module hash\.
e4f1f57 isaacs move some stuff around, add various meta things that are nice
isaacs authored
301 .
302 .P
303 Providing an explicit modules hash is encouraged over exposing the entire lib
304 folder\.
4792d40 isaacs Put directories.lib info back in the doc, and document the repository se...
isaacs authored
305 .
c1cc130 isaacs make doc
isaacs authored
306 .SS "directories\.bin"
307 If you specify a "bin" directory, then all the files in that folder will be used
308 as the "bin" hash\.
309 .
310 .P
311 If you have a "bin" hash already, then this has no effect\.
312 .
8299e4f isaacs Add info about a few directories that are relevant
isaacs authored
313 .SS "directories\.man"
314 A folder that is full of man pages\. Sugar to generate a "man" array by walking the folder\.
315 .
316 .SS "directories\.doc"
317 Put markdown files in here\. Eventually, these will be displayed nicely, maybe, someday\.
318 .
319 .SS "directories\.example"
320 Put example scripts in here\. Someday, it might be exposed in some clever way\.
321 .
4792d40 isaacs Put directories.lib info back in the doc, and document the repository se...
isaacs authored
322 .SH "repository"
323 Specify the place where your code lives\. This is helpful for people who want to
324 contribute, as well as perhaps maybe being the underpinning of some magical "track
325 this package on git" feature someday maybe if somebody wants to write it ever\.
326 .
327 .P
328 Do it like this:
329 .
330 .IP "" 4
331 .
332 .nf
333 "repository" :
334 { "type" : "git"
335 , "url" : "http://github\.com/isaacs/npm\.git"
336 }
337 "repository" :
338 { "type" : "svn"
339 , "url" : "http://v8\.googlecode\.com/svn/trunk/"
340 }
341 .
342 .fi
343 .
344 .IP "" 0
345 .
346 .P
347 The URL should be a publicly available (perhaps read\-only) url that can be handed
348 directly to a VCS program without any modification\. It should not be a url to an
349 html project page that you put in your browser\. It\'s for computers\.
350 .
351 .P
352 Here are some examples of Doing It Wrong:
353 .
354 .IP "" 4
355 .
356 .nf
357 WRONG!
358 "repository" :
359 { "type" : "git"
360 , "url" : "git@github\.com:isaacs/npm\.git" <\-\- THIS IS PRIVATE!
361 }
362 ALSO WRONG!
363 "repository" :
364 { "type" : "git"
365 , "url" : "http://github\.com/isaacs/npm" <\-\- THIS IS WEBPAGE!
366 }
085fbd4 isaacs Update json documentation
isaacs authored
367 This is ok, but completely unnecessary:
368 "repository" :
369 { "type" : "git"
370 , "url" : "http://github\.com/isaacs/npm\.git"
371 , "private" : "git@github\.com:isaacs/npm\.git"
372 , "web" : "http://github\.com/isaacs/npm"
373 }
4792d40 isaacs Put directories.lib info back in the doc, and document the repository se...
isaacs authored
374 .
375 .fi
376 .
377 .IP "" 0
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
378 .
379 .SH "scripts"
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
380 The "scripts" member is an object hash of script commands that are run
381 at various times in the lifecycle of your package\. The key is the lifecycle
382 event, and the value is the command to run at that point\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
383 .
384 .P
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
385 See \fBnpm help scripts\fR to find out more about writing package scripts\.
386 .
387 .SH "dependencies"
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
388 Dependencies are specified with a simple hash of package name to version
389 range\. The version range is EITHER a string with has one or more
390 space\-separated descriptors, OR a range like "fromVersion \- toVersion"
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
391 .
392 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
393 Version range descriptors may be any of the following styles, where "version"
394 is a semver compatible version identifier\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
395 .
396 .IP "\(bu" 4
397 \fBversion\fR Must match \fBversion\fR exactly
398 .
399 .IP "\(bu" 4
400 \fB=version\fR Same as just \fBversion\fR
401 .
402 .IP "\(bu" 4
403 \fB>version\fR Must be greater than \fBversion\fR
404 .
405 .IP "\(bu" 4
406 \fB>=version\fR etc
407 .
408 .IP "\(bu" 4
409 \fB<version\fR
410 .
411 .IP "\(bu" 4
412 \fB<=version\fR
413 .
414 .IP "\(bu" 4
415 \fB*\fR Matches any version
416 .
417 .IP "\(bu" 4
418 \fB""\fR (just an empty string) Same as \fB*\fR
419 .
420 .IP "\(bu" 4
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
421 \fBversion1 \- version2\fR Same as \fB>=version1 <=version2\fR\|\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
422 .
49b7bf0 isaacs Document the || in version ranges.
isaacs authored
423 .IP "\(bu" 4
424 \fBrange1 || range2\fR Passes if either range1 or range2 are satisfied\.
425 .
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
426 .IP "" 0
427 .
428 .P
429 For example, these are all valid:
430 .
431 .IP "" 4
432 .
433 .nf
434 { "dependencies" :
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
435 { "foo" : "1\.0\.0 \- 2\.9999\.9999"
436 , "bar" : ">=1\.0\.2 <2\.1\.2"
437 , "baz" : ">1\.0\.2 <=2\.3\.4"
438 , "boo" : "2\.0\.1"
49b7bf0 isaacs Document the || in version ranges.
isaacs authored
439 , "qux" : "<1\.0\.0 || >=2\.3\.1 <2\.4\.5 || >=2\.5\.2 <3\.0\.0"
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
440 }
441 }
442 .
443 .fi
444 .
445 .IP "" 0
446 .
447 .SH "engines"
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
448 Packages/1\.0 says that you can have an "engines" field with an array of engine
449 names\. However, it has no provision for specifying which version of the engine
450 your stuff runs on\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
451 .
452 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
453 With npm, you can use either of the following styles to specify the version of
454 node that your stuff works on:
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
455 .
456 .IP "" 4
457 .
458 .nf
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
459 { "engines" : [ "node >=0\.1\.27 <0\.1\.30" ] }
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
460 .
461 .fi
462 .
463 .IP "" 0
464 .
465 .P
466 or:
467 .
468 .IP "" 4
469 .
470 .nf
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
471 { "engines" : { "node" : ">=0\.1\.27 <0\.1\.30" } }
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
472 .
473 .fi
474 .
475 .IP "" 0
476 .
477 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
478 And, like with dependencies, if you don\'t specify the version (or if you
479 specify "*" as the version), then any version of node will do\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
480 .
481 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
482 If you specify an "engines" field, then npm will require that "node" be
483 somewhere on that list\. If "engines" is omitted, then npm will just assume
484 that it works on node\.
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
485 .
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
486 .SH "overlay"
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
487 npm responds to the \fBnode\fR and \fBnpm\fR env\-specific package\.json values, which
488 you can hang on the "overlay" key\.
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
489 .
490 .P
491 For example:
492 .
493 .IP "" 4
494 .
495 .nf
496 { "name" : "foo"
497 , "version" : 7
498 , "description" : "generic description"
499 , "overlay" :
500 { "node" :
501 { "name" : "bar"
502 , "description" : "description for node"
503 }
504 , "npm" :
505 { "version" : "1\.0\.7"
506 , "description" : "description for npm"
507 }
508 , "narwhal" :
509 { "description" : "description for narwhal" }
510 }
511 }
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
512 .
513 .fi
514 .
515 .IP "" 0
516 .
517 .P
da9eb9a isaacs Update json docs to be more comprehensive. Fix #45
isaacs authored
518 In this case, this is what npm will treat it as:
519 .
520 .IP "" 4
521 .
522 .nf
523 { "name" : "bar"
524 , "version" : "1\.0\.7"
525 , "description" : "description for npm"
526 }
527 .
528 .fi
529 .
530 .IP "" 0
b70b2a0 isaacs Add built documentation to project, so that the install doesn't require ...
isaacs authored
531 .
532 .P
f2ccd17 isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
533 This way, even if npm is not exactly the same as some other package management
534 system, you can still use both, and it can be a happy planet\.
Something went wrong with that request. Please try again.