1NPM-VIEW(1) NPM-VIEW(1)
2
3
4
6 npm-view - View registry info
7
9 npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
10
11 aliases: info, show, v
12
14 This command shows data about a package and prints it to the stream
15 referenced by the outfd config, which defaults to stdout.
16
17 To show the package registry entry for the connect package, you can do
18 this:
19
20 npm view connect
21
22 The default version is "latest" if unspecified.
23
24 Field names can be specified after the package descriptor. For exam‐
25 ple, to show the dependencies of the ronn package at version 0.3.5, you
26 could do the following:
27
28 npm view ronn@0.3.5 dependencies
29
30 You can view child fields by separating them with a period. To view
31 the git repository URL for the latest version of npm, you could do
32 this:
33
34 npm view npm repository.url
35
36 This makes it easy to view information about a dependency with a bit of
37 shell scripting. For example, to view all the data about the version
38 of opts that ronn depends on, you can do this:
39
40 npm view opts@$(npm view ronn dependencies.opts)
41
42 For fields that are arrays, requesting a non-numeric field will return
43 all of the values from the objects in the list. For example, to get
44 all the contributor names for the "express" project, you can do this:
45
46 npm view express contributors.email
47
48 You may also use numeric indices in square braces to specifically
49 select an item in an array field. To just get the email address of the
50 first contributor in the list, you can do this:
51
52 npm view express contributors[0].email
53
54 Multiple fields may be specified, and will be printed one after
55 another. For example, to get all the contributor names and email
56 addresses, you can do this:
57
58 npm view express contributors.name contributors.email
59
60 "Person" fields are shown as a string if they would be shown as an
61 object. So, for example, this will show the list of npm contributors
62 in the shortened string format. (See npm help 5 package.json for more
63 on this.)
64
65 npm view npm contributors
66
67 If a version range is provided, then data will be printed for every
68 matching version of the package. This will show which version of jsdom
69 was required by each matching version of yui3:
70
71 npm view yui3@'>0.5.4' dependencies.jsdom
72
73 To show the connect package version history, you can do this:
74
75 npm view connect versions
76
78 If only a single string field for a single version is output, then it
79 will not be colorized or quoted, so as to enable piping the output to
80 another command. If the field is an object, it will be output as a
81 JavaScript object literal.
82
83 If the --json flag is given, the outputted fields will be JSON.
84
85 If the version range matches multiple versions, than each printed value
86 will be prefixed with the version it applies to.
87
88 If multiple fields are requested, than each of them are prefixed with
89 the field name.
90
92 · npm help search
93
94 · npm help 7 registry
95
96 · npm help config
97
98 · npm help 7 config
99
100 · npm help 5 npmrc
101
102 · npm help docs
103
104
105
106
107
108 October 2019 NPM-VIEW(1)