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