Skip to content

HTTPS clone URL

Subversion checkout URL

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