Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 86 lines (56 sloc) 2.689 kb
c11abe7 isaacs doc for view command
isaacs authored
1 npm-view(1) -- View registry info
2 =================================
3
4 ## SYNOPSIS
5
ec15d6a Evan Meagher Standardize synopsis format in docs.
evnm authored
6 npm view <name>[@<version>] [<field>[.<subfield>]...]
c11abe7 isaacs doc for view command
isaacs authored
7
8 ## DESCRIPTION
9
cf98f26 isaacs Docs for new npm view command
isaacs authored
10 This command shows data about a package and prints it to the stream
11 referenced by the `outfd` config, which defaults to stdout.
c11abe7 isaacs doc for view command
isaacs authored
12
cf98f26 isaacs Docs for new npm view command
isaacs authored
13 To show the package registry entry for the `connect` package, you can do
14 this:
15
16 npm view connect
17
18 The default version is "latest" if unspecified.
19
20 Field names can be specified after the package descriptor.
21 For example, to show the dependencies of the `ronn` package at version
22 0.3.5, you could do the following:
23
24 npm view ronn@0.3.5 dependencies
25
26 You can view child field by separating them with a period.
27 To view the git repository URL for the latest version of npm, you could
28 do this:
29
30 npm view npm repository.url
31
32 This makes it easy to view information about a dependency with a bit of
33 shell scripting. For example, to view all the data about the version of
34 opts that ronn depends on, you can do this:
35
36 npm view opts@$(npm view ronn dependencies.opts)
37
38 For fields that are arrays, requesting a non-numeric field will return
39 all of the values from the objects in the list. For example, to get all
40 the contributor names for the "express" project, you can do this:
41
42 npm view express contributors.email
43
44 You may also use numeric indices in square braces to specifically select
45 an item in an array field. To just get the email address of the first
46 contributor in the list, you can do this:
47
48 npm view express contributors[0].email
49
50 Multiple fields may be specified, and will be printed one after another.
51 For exampls, to get all the contributor names and email addresses, you
52 can do this:
53
54 npm view express contributors.name contributors.email
55
56 "Person" fields are shown as a string if they would be shown as an
57 object. So, for example, this will show the list of npm contributors in
ad8bb00 isaacs Always use npm-blah(1) in the md, convert appropriately
isaacs authored
58 the shortened string format. (See `npm-json(1)` for more on this.)
cf98f26 isaacs Docs for new npm view command
isaacs authored
59
60 npm view npm contributors
61
62 If a version range is provided, then data will be printed for every
63 matching version of the package. This will show which version of jsdom
64 was required by each matching version of yui3:
65
66 npm view yui3@'>0.5.4' dependencies.jsdom
67
68 ## OUTPUT
69
70 If only a single string field for a single version is output, then it
71 will not be colorized or quoted, so as to enable piping the output to
72 another command.
73
74 If the version range matches multiple versions, than each printed value
75 will be prefixed with the version it applies to.
76
77 If multiple fields are requested, than each of them are prefixed with
78 the field name.
b19d703 isaacs Add SEE ALSO to all doc sections, and rebuild
isaacs authored
79
80 ## SEE ALSO
81
82 * npm-search(1)
83 * npm-registry(1)
84 * npm-config(1)
08042cf isaacs more linking
isaacs authored
85 * npm-docs(1)
Something went wrong with that request. Please try again.