1NPM-VIEW(1)                                                        NPM-VIEW(1)
2
3
4

NAME

6       npm-view - View registry info
7
8   Synopsis
9         npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
10
11         aliases: info, show, v
12
13   Description
14       This command shows data about a package and prints it to stdout.
15
16       As  an  example, to view information about the connect package from the
17       registry, you would run:
18
19         npm view connect
20
21       The default version is "latest" if unspecified.
22
23       Field names can be specified after the package descriptor.   For  exam‐
24       ple, to show the dependencies of the ronn package at version 0.3.5, you
25       could do the following:
26
27         npm view ronn@0.3.5 dependencies
28
29       You can view child fields by separating them with a  period.   To  view
30       the git repository URL for the latest version of npm, you would run the
31       following command:
32
33         npm view npm repository.url
34
35       This makes it easy to view information about a dependency with a bit of
36       shell scripting. For example, to view all the data about the version of
37       opts that ronn depends on, you could write the following:
38
39         npm view opts@$(npm view ronn dependencies.opts)
40
41       For fields that are arrays, requesting a non-numeric field will  return
42       all of the values from the objects in the list. For example, to get all
43       the contributor email addresses for the express package, you would run:
44
45         npm view express contributors.email
46
47       You may also use numeric indices in square braces to  specifically  se‐
48       lect  an  item  in an array field. To just get the email address of the
49       first contributor in the list, you can run:
50
51         npm view express contributors[0].email
52
53       Multiple fields may be specified, and will be  printed  one  after  an‐
54       other.   For  example,  to  get all the contributor names and email ad‐
55       dresses, you can do this:
56
57         npm view express contributors.name contributors.email
58
59       "Person" fields are shown as a string if they would be shown as an  ob‐
60       ject.   So, for example, this will show the list of npm contributors in
61       the shortened string format.  (See npm help package.json  for  more  on
62       this.)
63
64         npm view npm contributors
65
66       If  a  version  range  is provided, then data will be printed for every
67       matching version of the package.  This will show which version of jsdom
68       was required by each matching version of yui3:
69
70         npm view yui3@'>0.5.4' dependencies.jsdom
71
72       To show the connect package version history, you can do this:
73
74         npm view connect versions
75
76   Configuration
77       <!--  AUTOGENERATED  CONFIG  DESCRIPTIONS  START --> <!-- automatically
78       generated, do not edit manually --> <!--  see  lib/utils/config/defini‐
79       tions.js -->
80
81   json
82       • Default: false
83
84       • Type: Boolean
85
86
87       Whether or not to output JSON data, rather than the normal output.
88
89       • In npm pkg set it enables parsing set values with JSON.parse() before
90         saving them to your package.json.
91
92
93       Not supported by all npm commands.  <!--  automatically  generated,  do
94       not edit manually --> <!-- see lib/utils/config/definitions.js -->
95
96
97   workspace
98       • Default:
99
100       • Type: String (can be set multiple times)
101
102
103       Enable running a command in the context of the configured workspaces of
104       the current project while filtering by running only the workspaces  de‐
105       fined by this configuration option.
106
107       Valid values for the workspace config are either:
108
109       • Workspace names
110
111       • Path to a workspace directory
112
113       • Path to a parent workspace directory (will result to selecting all of
114         the nested workspaces)
115
116
117       When set for the npm init command, this may be set to the folder  of  a
118       workspace  which does not yet exist, to create the folder and set it up
119       as a brand new workspace within the project.
120
121       This value is not exported to  the  environment  for  child  processes.
122       <!--  automatically  generated,  do  not  edit  manually  -->  <!-- see
123       lib/utils/config/definitions.js -->
124
125
126   workspaces
127       • Default: false
128
129       • Type: Boolean
130
131
132       Enable  running  a  command  in  the  context  of  all  the  configured
133       workspaces.
134
135       This  value  is  not  exported  to the environment for child processes.
136       <!-- automatically  generated,  do  not  edit  manually  -->  <!--  see
137       lib/utils/config/definitions.js -->
138
139       <!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
140
141
142   Output
143       If  only  a single string field for a single version is output, then it
144       will not be colorized or quoted, to enable piping the output to another
145       command.  If  the field is an object, it will be output as a JavaScript
146       object literal.
147
148       If the --json flag is given, the outputted fields will be JSON.
149
150       If the version range matches multiple versions then each printed  value
151       will be prefixed with the version it applies to.
152
153       If  multiple  fields  are requested, then each of them is prefixed with
154       the field name.
155
156   See Also
157       • npm help search
158
159       • npm help registry
160
161       • npm help config
162
163       • npm help npmrc
164
165       • npm help docs
166
167
168
169
170                                 October 2021                      NPM-VIEW(1)
Impressum