The data contained in this repository can be downloaded to your computer using one of several clients.
Please see the documentation of your version control software client for more information.
Please select the desired protocol below to get the URL.
This URL has Read-Only access.
main_repo / deps / npm / html / doc / view.html @ 5aef65a9
History | View | Annotate | Download (4.37 KB)
1 |
<!doctype html>
|
---|---|
2 |
<html>
|
3 |
<title>view</title> |
4 |
<meta http-equiv="content-type" value="text/html;utf-8"> |
5 |
<link rel="stylesheet" type="text/css" href="../static/style.css"> |
6 |
|
7 |
<body>
|
8 |
<div id="wrapper"> |
9 |
<h1><a href="../doc/view.html">view</a></h1> <p>View registry info</p> |
10 |
|
11 |
<h2 id="SYNOPSIS">SYNOPSIS</h2> |
12 |
|
13 |
<pre><code>npm view <name>[@<version>] [<field>[.<subfield>]...]</code></pre> |
14 |
|
15 |
<h2 id="DESCRIPTION">DESCRIPTION</h2> |
16 |
|
17 |
<p>This command shows data about a package and prints it to the stream
|
18 |
referenced by the <code>outfd</code> config, which defaults to stdout.</p> |
19 |
|
20 |
<p>To show the package registry entry for the <code>connect</code> package, you can do |
21 |
this:</p>
|
22 |
|
23 |
<pre><code>npm view connect</code></pre> |
24 |
|
25 |
<p>The default version is "latest" if unspecified.</p> |
26 |
|
27 |
<p>Field names can be specified after the package descriptor.
|
28 |
For example, to show the dependencies of the <code>ronn</code> package at version |
29 |
0.3.5, you could do the following:</p>
|
30 |
|
31 |
<pre><code>npm view ronn@0.3.5 dependencies</code></pre> |
32 |
|
33 |
<p>You can view child field by separating them with a period.
|
34 |
To view the git repository URL for the latest version of npm, you could |
35 |
do this:</p>
|
36 |
|
37 |
<pre><code>npm view npm repository.url</code></pre> |
38 |
|
39 |
<p>This makes it easy to view information about a dependency with a bit of
|
40 |
shell scripting. For example, to view all the data about the version of |
41 |
opts that ronn depends on, you can do this:</p>
|
42 |
|
43 |
<pre><code>npm view opts@$(npm view ronn dependencies.opts)</code></pre> |
44 |
|
45 |
<p>For fields that are arrays, requesting a non-numeric field will return
|
46 |
all of the values from the objects in the list. For example, to get all |
47 |
the contributor names for the "express" project, you can do this:</p> |
48 |
|
49 |
<pre><code>npm view express contributors.email</code></pre> |
50 |
|
51 |
<p>You may also use numeric indices in square braces to specifically select
|
52 |
an item in an array field. To just get the email address of the first |
53 |
contributor in the list, you can do this:</p>
|
54 |
|
55 |
<pre><code>npm view express contributors[0].email</code></pre> |
56 |
|
57 |
<p>Multiple fields may be specified, and will be printed one after another.
|
58 |
For exampls, to get all the contributor names and email addresses, you |
59 |
can do this:</p>
|
60 |
|
61 |
<pre><code>npm view express contributors.name contributors.email</code></pre> |
62 |
|
63 |
<p>"Person" fields are shown as a string if they would be shown as an |
64 |
object. So, for example, this will show the list of npm contributors in |
65 |
the shortened string format. (See <code><a href="../doc/json.html">json(1)</a></code> for more on this.)</p> |
66 |
|
67 |
<pre><code>npm view npm contributors</code></pre> |
68 |
|
69 |
<p>If a version range is provided, then data will be printed for every
|
70 |
matching version of the package. This will show which version of jsdom |
71 |
was required by each matching version of yui3:</p>
|
72 |
|
73 |
<pre><code>npm view yui3@'>0.5.4' dependencies.jsdom</code></pre> |
74 |
|
75 |
<h2 id="OUTPUT">OUTPUT</h2> |
76 |
|
77 |
<p>If only a single string field for a single version is output, then it
|
78 |
will not be colorized or quoted, so as to enable piping the output to |
79 |
another command. If the field is an object, it will be output as a JavaScript object literal.</p>
|
80 |
|
81 |
<p>If the --json flag is given, the outputted fields will be JSON.</p> |
82 |
|
83 |
<p>If the version range matches multiple versions, than each printed value
|
84 |
will be prefixed with the version it applies to.</p>
|
85 |
|
86 |
<p>If multiple fields are requested, than each of them are prefixed with
|
87 |
the field name.</p>
|
88 |
|
89 |
<h2 id="SEE-ALSO">SEE ALSO</h2> |
90 |
|
91 |
<ul><li><a href="../doc/search.html">search(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/docs.html">docs(1)</a></li></ul> |
92 |
</div>
|
93 |
<p id="footer">view — npm@1.2.10</p> |
94 |
<script>
|
95 |
;(function () {
|
96 |
var wrapper = document.getElementById("wrapper")
|
97 |
var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
|
98 |
.filter(function (el) {
|
99 |
return el.parentNode === wrapper
|
100 |
&& el.tagName.match(/H[1-6]/)
|
101 |
&& el.id
|
102 |
})
|
103 |
var l = 2
|
104 |
, toc = document.createElement("ul")
|
105 |
toc.innerHTML = els.map(function (el) {
|
106 |
var i = el.tagName.charAt(1)
|
107 |
, out = ""
|
108 |
while (i > l) {
|
109 |
out += "<ul>"
|
110 |
l ++
|
111 |
}
|
112 |
while (i < l) {
|
113 |
out += "</ul>"
|
114 |
l --
|
115 |
}
|
116 |
out += "<li><a href='#" + el.id + "'>" +
|
117 |
( el.innerText || el.text || el.innerHTML)
|
118 |
+ "</a>"
|
119 |
return out
|
120 |
}).join("\n")
|
121 |
toc.id = "toc"
|
122 |
document.body.appendChild(toc)
|
123 |
})()
|
124 |
</script>
|
125 |
</body></html> |