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