1NPM-FUND(1) NPM-FUND(1)
2
3
4
6 npm-fund - Retrieve funding information
7
8 Synopsis
9 npm fund [<pkg>]
10 npm fund [-w <workspace-name>]
11
12 Description
13 This command retrieves information on how to fund the dependencies of a
14 given project. If no package name is provided, it will list all depen‐
15 dencies that are looking for funding in a tree structure, listing the
16 type of funding and the url to visit. If a package name is provided
17 then it tries to open its funding url using the --browser config param;
18 if there are multiple funding sources for the package, the user will be
19 instructed to pass the --which option to disambiguate.
20
21 The list will avoid duplicated entries and will stack all packages that
22 share the same url as a single entry. Thus, the list does not have the
23 same shape of the output from npm ls.
24
25 Example
26 Workspaces support
27 It's possible to filter the results to only include a single workspace
28 and its dependencies using the workspace config option.
29
30 Example:
31 Here's an example running npm fund in a project with a configured
32 workspace a:
33
34 $ npm fund
35 test-workspaces-fund@1.0.0
36 +-- https://example.com/a
37 | | `-- a@1.0.0
38 | `-- https://example.com/maintainer
39 | `-- foo@1.0.0
40 +-- https://example.com/npmcli-funding
41 | `-- @npmcli/test-funding
42 `-- https://example.com/org
43 `-- bar@2.0.0
44
45 And here is an example of the expected result when filtering only by a
46 specific workspace a in the same project:
47
48 $ npm fund -w a
49 test-workspaces-fund@1.0.0
50 `-- https://example.com/a
51 | `-- a@1.0.0
52 `-- https://example.com/maintainer
53 `-- foo@2.0.0
54
55 Configuration
56 <!-- AUTOGENERATED CONFIG DESCRIPTIONS START --> <!-- automatically
57 generated, do not edit manually --> <!-- see lib/utils/config/defini‐
58 tions.js -->
59
60 json
61 • Default: false
62
63 • Type: Boolean
64
65
66 Whether or not to output JSON data, rather than the normal output.
67
68 • In npm pkg set it enables parsing set values with JSON.parse() before
69 saving them to your package.json.
70
71
72 Not supported by all npm commands. <!-- automatically generated, do
73 not edit manually --> <!-- see lib/utils/config/definitions.js -->
74
75
76 browser
77 • Default: OS X: "open", Windows: "start", Others: "xdg-open"
78
79 • Type: null, Boolean, or String
80
81
82 The browser that is called by npm commands to open websites.
83
84 Set to false to suppress browser behavior and instead print urls to
85 terminal.
86
87 Set to true to use default system URL opener. <!-- automatically gen‐
88 erated, do not edit manually --> <!-- see lib/utils/config/defini‐
89 tions.js -->
90
91
92 unicode
93 • Default: false on windows, true on mac/unix systems with a unicode
94 locale, as defined by the LC_ALL, LC_CTYPE, or LANG environment vari‐
95 ables.
96
97 • Type: Boolean
98
99
100 When set to true, npm uses unicode characters in the tree output. When
101 false, it uses ascii characters instead of unicode glyphs. <!-- auto‐
102 matically generated, do not edit manually --> <!-- see lib/utils/con‐
103 fig/definitions.js -->
104
105
106 workspace
107 • Default:
108
109 • Type: String (can be set multiple times)
110
111
112 Enable running a command in the context of the configured workspaces of
113 the current project while filtering by running only the workspaces de‐
114 fined by this configuration option.
115
116 Valid values for the workspace config are either:
117
118 • Workspace names
119
120 • Path to a workspace directory
121
122 • Path to a parent workspace directory (will result in selecting all
123 workspaces within that folder)
124
125
126 When set for the npm init command, this may be set to the folder of a
127 workspace which does not yet exist, to create the folder and set it up
128 as a brand new workspace within the project.
129
130 This value is not exported to the environment for child processes.
131 <!-- automatically generated, do not edit manually --> <!-- see
132 lib/utils/config/definitions.js -->
133
134
135 which
136 • Default: null
137
138 • Type: null or Number
139
140
141 If there are multiple funding sources, which 1-indexed source URL to
142 open. <!-- automatically generated, do not edit manually --> <!-- see
143 lib/utils/config/definitions.js -->
144
145 <!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
146
147
149 • npm help install
150
151 • npm help docs
152
153 • npm help ls
154
155 • npm help config
156
157 • npm help workspaces
158
159
160
161
162 January 2022 NPM-FUND(1)