]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/doc/api/npm-view.md
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / doc / api / npm-view.md
1 npm-view(3) -- View registry info
2 =================================
3
4 ## SYNOPSIS
5
6     npm.commands.view(args, [silent,] callback)
7
8 ## DESCRIPTION
9
10 This command shows data about a package and prints it to the stream
11 referenced by the `outfd` config, which defaults to stdout.
12
13 The "args" parameter is an ordered list that closely resembles the command-line
14 usage. The elements should be ordered such that the first element is
15 the package and version (package@version). The version is optional. After that,
16 the rest of the parameters are fields with optional subfields ("field.subfield")
17 which can be used to get only the information desired from the registry.
18
19 The callback will be passed all of the data returned by the query.
20
21 For example, to get the package registry entry for the `connect` package,
22 you can do this:
23
24     npm.commands.view(["connect"], callback)
25
26 If no version is specified, "latest" is assumed.
27
28 Field names can be specified after the package descriptor.
29 For example, to show the dependencies of the `ronn` package at version
30 0.3.5, you could do the following:
31
32     npm.commands.view(["ronn@0.3.5", "dependencies"], callback)
33
34 You can view child field by separating them with a period.
35 To view the git repository URL for the latest version of npm, you could
36 do this:
37
38     npm.commands.view(["npm", "repository.url"], callback)
39
40 For fields that are arrays, requesting a non-numeric field will return
41 all of the values from the objects in the list.  For example, to get all
42 the contributor names for the "express" project, you can do this:
43
44     npm.commands.view(["express", "contributors.email"], callback)
45
46 You may also use numeric indices in square braces to specifically select
47 an item in an array field.  To just get the email address of the first
48 contributor in the list, you can do this:
49
50     npm.commands.view(["express", "contributors[0].email"], callback)
51
52 Multiple fields may be specified, and will be printed one after another.
53 For exampls, to get all the contributor names and email addresses, you
54 can do this:
55
56     npm.commands.view(["express", "contributors.name", "contributors.email"], callback)
57
58 "Person" fields are shown as a string if they would be shown as an
59 object.  So, for example, this will show the list of npm contributors in
60 the shortened string format.  (See `npm help json` for more on this.)
61
62     npm.commands.view(["npm", "contributors"], callback)
63
64 If a version range is provided, then data will be printed for every
65 matching version of the package.  This will show which version of jsdom
66 was required by each matching version of yui3:
67
68     npm.commands.view(["yui3@>0.5.4", "dependencies.jsdom"], callback)
69
70 ## OUTPUT
71
72 If only a single string field for a single version is output, then it
73 will not be colorized or quoted, so as to enable piping the output to
74 another command.
75
76 If the version range matches multiple versions, than each printed value
77 will be prefixed with the version it applies to.
78
79 If multiple fields are requested, than each of them are prefixed with
80 the field name.
81
82 Console output can be disabled by setting the 'silent' parameter to true.
83
84 ## RETURN VALUE
85
86 The data returned will be an object in this formation:
87
88     { <version>:
89       { <field>: <value>
90       , ... }
91     , ... }
92
93 corresponding to the list of fields selected.