1NPM-FUND(1)                                                        NPM-FUND(1)
2
3
4

NAME

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

See Also

129       • npm help package spec
130
131       • npm help install
132
133       • npm help docs
134
135       • npm help ls
136
137       • npm help config
138
139       • npm help workspaces
140
141
142
143
144                                September 2022                     NPM-FUND(1)
Impressum