2025-04-10 14:36:22 -07:00
.TH "NPM-FUND" "1" "April 2025" "NPM@11.3.0" ""
2019-11-05 14:55:08 -05:00
.SH "NAME"
2022-12-06 22:18:33 -05:00
\fB npm-fund\fR - Retrieve funding information
.SS "Synopsis"
2019-11-05 14:55:08 -05:00
.P
.RS 2
.nf
2022-12-06 22:18:33 -05:00
npm fund \[ lB]<package-spec>\[ rB]
2019-11-05 14:55:08 -05:00
.fi
.RE
2022-12-06 22:18:33 -05:00
.SS "Description"
2019-11-05 14:55:08 -05:00
.P
2022-12-06 22:18:33 -05:00
This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. If a package name is provided then it tries to open its funding url using the \fB \fB --browser\fR config\fR \fI \(la /using-npm/config#browser\(ra \fR param; if there are multiple funding sources for the package, the user will be instructed to pass the \fB --which\fR option to disambiguate.
2019-11-05 14:55:08 -05:00
.P
2022-12-06 22:18:33 -05:00
The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. Thus, the list does not have the same shape of the output from \fB npm ls\fR .
.SS "Example"
.SS "Workspaces support"
2021-05-13 16:18:53 -04:00
.P
2022-12-06 22:18:33 -05:00
It's possible to filter the results to only include a single workspace and its dependencies using the \fB \fB workspace\fR config\fR \fI \(la /using-npm/config#workspace\(ra \fR option.
.SS "Example:"
2021-05-13 16:18:53 -04:00
.P
2022-12-06 22:18:33 -05:00
Here's an example running \fB npm fund\fR in a project with a configured workspace \fB a\fR :
2021-05-13 16:18:53 -04:00
.P
.RS 2
.nf
$ npm fund
2022-12-06 22:18:33 -05:00
test-workspaces-fund@1.0.0
+-- https://example.com/a
| | `-- a@1.0.0
| `-- https://example.com/maintainer
| `-- foo@1.0.0
+-- https://example.com/npmcli-funding
| `-- @npmcli/test-funding
`-- https://example.com/org
`-- bar@2.0.0
2021-05-13 16:18:53 -04:00
.fi
.RE
.P
2022-12-06 22:18:33 -05:00
And here is an example of the expected result when filtering only by a specific workspace \fB a\fR in the same project:
2021-05-13 16:18:53 -04:00
.P
.RS 2
.nf
2022-12-06 22:18:33 -05:00
$ npm fund -w a
test-workspaces-fund@1.0.0
`-- https://example.com/a
| `-- a@1.0.0
`-- https://example.com/maintainer
`-- foo@2.0.0
2021-05-13 16:18:53 -04:00
.fi
.RE
2022-12-06 22:18:33 -05:00
.SS "Configuration"
.SS "\fBjson\fR"
2019-11-05 14:55:08 -05:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: false
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2019-11-05 14:55:08 -05:00
.P
2022-12-06 22:18:33 -05:00
Whether or not to output JSON data, rather than the normal output.
2021-07-15 20:09:18 +00:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
In \fB npm pkg set\fR it enables parsing set values with JSON.parse() before saving them to your \fB package.json\fR .
.RE 0
2021-07-15 20:09:18 +00:00
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Not supported by all npm commands.
.SS "\fBbrowser\fR"
2019-11-05 14:55:08 -05:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: OS X: \fB "open"\fR , Windows: \fB "start"\fR , Others: \fB "xdg-open"\fR
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: null, Boolean, or String
2022-12-06 22:18:33 -05:00
.RE 0
2019-11-05 14:55:08 -05:00
.P
2022-12-06 22:18:33 -05:00
The browser that is called by npm commands to open websites.
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Set to \fB false\fR to suppress browser behavior and instead print urls to terminal.
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Set to \fB true\fR to use default system URL opener.
.SS "\fBunicode\fR"
2019-11-05 14:55:08 -05:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: false on windows, true on mac/unix systems with a unicode locale, as defined by the \fB LC_ALL\fR , \fB LC_CTYPE\fR , or \fB LANG\fR environment variables.
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2019-11-05 14:55:08 -05:00
.P
2022-12-06 22:18:33 -05:00
When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs.
.SS "\fBworkspace\fR"
2021-05-13 16:18:53 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-13 16:18:53 -04:00
Default:
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-13 16:18:53 -04:00
Type: String (can be set multiple times)
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-13 16:18:53 -04:00
.P
2022-12-06 22:18:33 -05:00
Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.
2021-05-13 16:18:53 -04:00
.P
2022-12-06 22:18:33 -05:00
Valid values for the \fB workspace\fR config are either:
2021-05-13 16:18:53 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-13 16:18:53 -04:00
Workspace names
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-13 16:18:53 -04:00
Path to a workspace directory
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Path to a parent workspace directory (will result in selecting all workspaces within that folder)
.RE 0
2021-05-13 16:18:53 -04:00
.P
2022-12-06 22:18:33 -05:00
When set for the \fB npm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
This value is not exported to the environment for child processes.
.SS "\fBwhich\fR"
2020-02-26 17:11:08 -08:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default: null
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: null or Number
2022-12-06 22:18:33 -05:00
.RE 0
2020-02-26 17:11:08 -08:00
.P
2022-12-06 22:18:33 -05:00
If there are multiple funding sources, which 1-indexed source URL to open.
.SH "SEE ALSO"
2019-11-05 14:55:08 -05:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2022-11-07 13:02:05 -05:00
npm help "package spec"
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help install
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2020-11-01 07:54:36 +01:00
npm help docs
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help ls
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2020-11-01 07:54:36 +01:00
npm help config
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-13 16:18:53 -04:00
npm help workspaces
2022-12-06 22:18:33 -05:00
.RE 0