.TH "NPM\-VIEW" "1" "November 2022" "9.1.1" .SH "NAME" \fBnpm-view\fR .SH Synopsis .SH Description .P This command shows data about a package and prints it to stdout\. .P As an example, to view information about the \fBconnect\fP package from the registry, you would run: .RS 2 .nf npm view connect .fi .RE .P The default version is \fB"latest"\fP if unspecified\. .P Field names can be specified after the package descriptor\. .br For example, to show the dependencies of the \fBronn\fP package at version .br \fB0\.3\.5\fP, you could do the following: .RS 2 .nf npm view ronn@0\.3\.5 dependencies .fi .RE .P You can view child fields by separating them with a period\. .br To view the git repository URL for the latest version of \fBnpm\fP, you would run the following command: .RS 2 .nf npm view npm repository\.url .fi .RE .P This makes it easy to view information about a dependency with a bit of .br shell scripting\. For example, to view all the data about the version of .br \fBopts\fP that \fBronn\fP depends on, you could write the following: .RS 2 .nf npm view opts@$(npm view ronn dependencies\.opts) .fi .RE .P For fields that are arrays, requesting a non\-numeric field will return .br all of the values from the objects in the list\. For example, to get all .br the contributor email addresses for the \fBexpress\fP package, you would run: .RS 2 .nf npm view express contributors\.email .fi .RE .P You may also use numeric indices in square braces to specifically select .br an item in an array field\. To just get the email address of the first .br contributor in the list, you can run: .RS 2 .nf npm view express contributors[0]\.email .fi .RE .P If the field value you are querying for is a property of an object, you should run: .RS 2 .nf npm view express time'[4\.8\.0]' .fi .RE .P Multiple fields may be specified, and will be printed one after another\. .br For example, to get all the contributor names and email addresses, you .br can do this: .RS 2 .nf npm view express contributors\.name contributors\.email .fi .RE .P "Person" fields are shown as a string if they would be shown as an .br object\. So, for example, this will show the list of \fBnpm\fP contributors in .br the shortened string format\. (See \fBpackage\.json\fP for more on this\.) .RS 2 .nf npm view npm contributors .fi .RE .P If a version range is provided, then data will be printed for every .br matching version of the package\. This will show which version of \fBjsdom\fP .br was required by each matching version of \fByui3\fP: .RS 2 .nf npm view yui3@'>0\.5\.4' dependencies\.jsdom .fi .RE .P To show the \fBconnect\fP package version history, you can do .br this: .RS 2 .nf npm view connect versions .fi .RE .SH Configuration .SH Output .P If only a single string field for a single version is output, then it .br will not be colorized or quoted, to enable piping the output to .br another command\. If the field is an object, it will be output as a JavaScript object literal\. .P If the \fB\-\-json\fP flag is given, the outputted fields will be JSON\. .P If the version range matches multiple versions then each printed value .br will be prefixed with the version it applies to\. .P If multiple fields are requested, then each of them is prefixed with .br the field name\. .SH See Also .RS 1 .IP \(bu 2 package spec .IP \(bu 2 npm search .IP \(bu 2 npm registry .IP \(bu 2 npm config .IP \(bu 2 npmrc .IP \(bu 2 npm docs .RE