Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 160 lines (159 sloc) 3.084 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/
c11abe7 @isaacs doc for view command
isaacs authored
3 .
0ce9853 @isaacs make doc
isaacs authored
4 .TH "NPM\-VIEW" "1" "March 2011" "" ""
c11abe7 @isaacs doc for view command
isaacs authored
5 .
6 .SH "NAME"
f2ccd17 @isaacs Use ronnjs instead of the ronn rubygem to build docs
isaacs authored
7 \fBnpm-view\fR \-\- View registry info
c11abe7 @isaacs doc for view command
isaacs authored
8 .
9 .SH "SYNOPSIS"
10 .
11 .nf
ec15d6a @evnm Standardize synopsis format in docs.
evnm authored
12 npm view <name>[@<version>] [<field>[\.<subfield>]\.\.\.]
c11abe7 @isaacs doc for view command
isaacs authored
13 .
14 .fi
15 .
16 .SH "DESCRIPTION"
cf98f26 @isaacs Docs for new npm view command
isaacs authored
17 This command shows data about a package and prints it to the stream
18 referenced by the \fBoutfd\fR config, which defaults to stdout\.
c11abe7 @isaacs doc for view command
isaacs authored
19 .
20 .P
cf98f26 @isaacs Docs for new npm view command
isaacs authored
21 To show the package registry entry for the \fBconnect\fR package, you can do
22 this:
23 .
24 .IP "" 4
25 .
26 .nf
27 npm view connect
28 .
29 .fi
30 .
31 .IP "" 0
32 .
33 .P
34 The default version is "latest" if unspecified\.
35 .
36 .P
37 Field names can be specified after the package descriptor\.
38 For example, to show the dependencies of the \fBronn\fR package at version
39 0\.3\.5, you could do the following:
40 .
41 .IP "" 4
42 .
43 .nf
44 npm view ronn@0\.3\.5 dependencies
45 .
46 .fi
47 .
48 .IP "" 0
49 .
50 .P
51 You can view child field by separating them with a period\.
52 To view the git repository URL for the latest version of npm, you could
53 do this:
54 .
55 .IP "" 4
56 .
57 .nf
58 npm view npm repository\.url
59 .
60 .fi
61 .
62 .IP "" 0
63 .
64 .P
65 This makes it easy to view information about a dependency with a bit of
66 shell scripting\. For example, to view all the data about the version of
67 opts that ronn depends on, you can do this:
68 .
69 .IP "" 4
70 .
71 .nf
72 npm view opts@$(npm view ronn dependencies\.opts)
73 .
74 .fi
75 .
76 .IP "" 0
77 .
78 .P
79 For fields that are arrays, requesting a non\-numeric field will return
80 all of the values from the objects in the list\. For example, to get all
81 the contributor names for the "express" project, you can do this:
82 .
83 .IP "" 4
84 .
85 .nf
86 npm view express contributors\.email
87 .
88 .fi
89 .
90 .IP "" 0
91 .
92 .P
93 You may also use numeric indices in square braces to specifically select
94 an item in an array field\. To just get the email address of the first
95 contributor in the list, you can do this:
96 .
97 .IP "" 4
98 .
99 .nf
100 npm view express contributors[0]\.email
101 .
102 .fi
103 .
104 .IP "" 0
105 .
106 .P
107 Multiple fields may be specified, and will be printed one after another\.
108 For exampls, to get all the contributor names and email addresses, you
109 can do this:
110 .
111 .IP "" 4
112 .
113 .nf
114 npm view express contributors\.name contributors\.email
115 .
116 .fi
117 .
118 .IP "" 0
119 .
120 .P
121 "Person" fields are shown as a string if they would be shown as an
122 object\. So, for example, this will show the list of npm contributors in
123 the shortened string format\. (See \fBnpm help json\fR for more on this\.)
124 .
125 .IP "" 4
126 .
127 .nf
128 npm view npm contributors
129 .
130 .fi
131 .
132 .IP "" 0
133 .
134 .P
135 If a version range is provided, then data will be printed for every
136 matching version of the package\. This will show which version of jsdom
137 was required by each matching version of yui3:
138 .
139 .IP "" 4
140 .
141 .nf
142 npm view yui3@\'>0\.5\.4\' dependencies\.jsdom
143 .
144 .fi
145 .
146 .IP "" 0
147 .
148 .SH "OUTPUT"
149 If only a single string field for a single version is output, then it
150 will not be colorized or quoted, so as to enable piping the output to
151 another command\.
152 .
153 .P
154 If the version range matches multiple versions, than each printed value
155 will be prefixed with the version it applies to\.
156 .
157 .P
158 If multiple fields are requested, than each of them are prefixed with
159 the field name\.
Something went wrong with that request. Please try again.