2021-05-10 17:31:02 -04:00
|
|
|
.TH "NPM\-VIEW" "1" "May 2021" "" ""
|
2011-11-26 09:21:03 -08:00
|
|
|
.SH "NAME"
|
2019-11-18 21:01:39 +02:00
|
|
|
\fBnpm-view\fR \- View registry info
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Synopsis
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2015-10-09 23:13:57 -07:00
|
|
|
npm view [<@scope>/]<name>[@<version>] [<field>[\.<subfield>]\.\.\.]
|
|
|
|
|
|
|
|
aliases: info, show, v
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Description
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
2021-04-01 17:27:18 -04:00
|
|
|
This command shows data about a package and prints it to stdout\.
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
2021-01-28 17:38:39 -05:00
|
|
|
As an example, to view information about the \fBconnect\fP package from the registry, you would run:
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2011-11-26 09:21:03 -08:00
|
|
|
npm view connect
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
2021-01-28 17:38:39 -05:00
|
|
|
The default version is \fB"latest"\fP if unspecified\.
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
Field names can be specified after the package descriptor\.
|
2015-07-24 15:09:52 -07:00
|
|
|
For example, to show the dependencies of the \fBronn\fP package at version
|
2021-01-28 17:38:39 -05:00
|
|
|
\fB0\.3\.5\fP, you could do the following:
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2011-11-26 09:21:03 -08:00
|
|
|
npm view ronn@0\.3\.5 dependencies
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
2015-01-23 06:56:30 -08:00
|
|
|
You can view child fields by separating them with a period\.
|
2021-01-28 17:38:39 -05:00
|
|
|
To view the git repository URL for the latest version of \fBnpm\fP, you would run the following command:
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2011-11-26 09:21:03 -08:00
|
|
|
npm view npm repository\.url
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
This makes it easy to view information about a dependency with a bit of
|
2021-01-28 17:38:39 -05:00
|
|
|
shell scripting\. For example, to view all the data about the version of
|
|
|
|
\fBopts\fP that \fBronn\fP depends on, you could write the following:
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2011-11-26 09:21:03 -08:00
|
|
|
npm view opts@$(npm view ronn dependencies\.opts)
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
For fields that are arrays, requesting a non\-numeric field will return
|
2021-01-28 17:38:39 -05:00
|
|
|
all of the values from the objects in the list\. For example, to get all
|
|
|
|
the contributor names for the \fBexpress\fP package, you would run:
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2011-11-26 09:21:03 -08:00
|
|
|
npm view express contributors\.email
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
You may also use numeric indices in square braces to specifically select
|
2021-01-28 17:38:39 -05:00
|
|
|
an item in an array field\. To just get the email address of the first
|
|
|
|
contributor in the list, you can run:
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2011-11-26 09:21:03 -08:00
|
|
|
npm view express contributors[0]\.email
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
Multiple fields may be specified, and will be printed one after another\.
|
2015-10-29 16:50:12 -07:00
|
|
|
For example, to get all the contributor names and email addresses, you
|
2011-11-26 09:21:03 -08:00
|
|
|
can do this:
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2011-11-26 09:21:03 -08:00
|
|
|
npm view express contributors\.name contributors\.email
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
"Person" fields are shown as a string if they would be shown as an
|
2021-01-28 17:38:39 -05:00
|
|
|
object\. So, for example, this will show the list of \fBnpm\fP contributors in
|
2019-11-18 21:01:39 +02:00
|
|
|
the shortened string format\. (See npm help \fBpackage\.json\fP for more on this\.)
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2011-11-26 09:21:03 -08:00
|
|
|
npm view npm contributors
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
|
|
|
If a version range is provided, then data will be printed for every
|
2021-01-28 17:38:39 -05:00
|
|
|
matching version of the package\. This will show which version of \fBjsdom\fP
|
|
|
|
was required by each matching version of \fByui3\fP:
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
|
|
|
.RS 2
|
2014-11-04 15:08:12 -08:00
|
|
|
.nf
|
2014-09-24 14:41:07 -07:00
|
|
|
npm view yui3@'>0\.5\.4' dependencies\.jsdom
|
2014-11-04 15:08:12 -08:00
|
|
|
.fi
|
2014-09-24 14:41:07 -07:00
|
|
|
.RE
|
2016-02-22 11:59:14 -08:00
|
|
|
.P
|
|
|
|
To show the \fBconnect\fP package version history, you can do
|
|
|
|
this:
|
|
|
|
.P
|
|
|
|
.RS 2
|
|
|
|
.nf
|
|
|
|
npm view connect versions
|
|
|
|
.fi
|
|
|
|
.RE
|
2021-04-29 16:30:06 -04:00
|
|
|
.SS Configuration
|
|
|
|
.SS json
|
|
|
|
.P
|
|
|
|
Show information in JSON format\. See \fBOutput\fP \fI#output\fR below\.
|
|
|
|
.SS workspaces
|
|
|
|
.P
|
|
|
|
Enables workspaces context while searching the \fBpackage\.json\fP in the
|
|
|
|
current folder\. Information about packages named in each workspace will
|
|
|
|
be viewed\.
|
|
|
|
.SS workspace
|
|
|
|
.P
|
|
|
|
Enables workspaces context and limits results to only those specified by
|
|
|
|
this config item\. Only the information about packages named in the
|
|
|
|
workspaces given here will be viewed\.
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS Output
|
2014-09-24 14:41:07 -07:00
|
|
|
.P
|
2011-11-26 09:21:03 -08:00
|
|
|
If only a single string field for a single version is output, then it
|
2021-01-28 17:38:39 -05:00
|
|
|
will not be colorized or quoted, to enable piping the output to
|
2012-12-21 16:42:29 +00:00
|
|
|
another command\. If the field is an object, it will be output as a JavaScript object literal\.
|
|
|
|
.P
|
2021-01-28 17:38:39 -05:00
|
|
|
If the \fB\-\-json\fP flag is given, the outputted fields will be JSON\.
|
2011-11-26 09:21:03 -08:00
|
|
|
.P
|
2021-01-28 17:38:39 -05:00
|
|
|
If the version range matches multiple versions then each printed value
|
2011-11-26 09:21:03 -08:00
|
|
|
will be prefixed with the version it applies to\.
|
|
|
|
.P
|
2021-01-28 17:38:39 -05:00
|
|
|
If multiple fields are requested, then each of them is prefixed with
|
2011-11-26 09:21:03 -08:00
|
|
|
the field name\.
|
2019-11-05 14:55:08 -05:00
|
|
|
.SS See Also
|
2014-09-24 14:41:07 -07:00
|
|
|
.RS 0
|
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help search
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-05 14:55:08 -05:00
|
|
|
npm help registry
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help config
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-05 14:55:08 -05:00
|
|
|
npm help npmrc
|
2014-09-24 14:41:07 -07:00
|
|
|
.IP \(bu 2
|
2019-11-18 21:01:39 +02:00
|
|
|
npm help docs
|
2014-09-24 14:41:07 -07:00
|
|
|
|
|
|
|
.RE
|