LinuxCommandLibrary

npm-fund

Discover funding information for npm package dependencies

TLDR

List dependencies with funding URL for the project in the current directory

$ npm fund
copy

Open the funding URL for a specific package in the default web browser
$ npm fund [package]
copy

List dependencies with a funding URL for a specific workspace for the project in the current directory
$ npm fund [[-w|--workspace]] [workspace]
copy

SYNOPSIS

npm fund []

PARAMETERS

package-name
    Name of a specific package to display funding information for. If omitted, displays funding information for all dependencies with available funding data.

DESCRIPTION

The `npm fund` command helps discover how to financially support the maintainers of your project's dependencies. It leverages the `funding` field in package manifests to locate funding opportunities, directing users to platforms like Open Collective, GitHub Sponsors, Patreon, or individual donation pages.

This command prioritizes highlighting projects with explicit funding support to encourage sustainable open source development. By providing a standardized way to discover funding mechanisms, `npm fund` aims to bridge the gap between open source users and maintainers, fostering a collaborative ecosystem where contributions are valued and supported.

CAVEATS

The accuracy of funding information depends on maintainers including the `funding` field in their package manifests. Not all packages provide this information, so `npm fund` may not always return results.

DISPLAYING FUNDING INFORMATION

When a package-name is specified, the command will attempt to open the funding URL for that specific package in your default web browser. If no package-name is specified, the command will attempt to open the funding URL for all fundable dependencies within the current project. If no funding url is available it display a message on the console.

CONFIGURATION

npm is configured via command-line options, environment variables, npmrc files, and the package.json file.

HISTORY

The `npm fund` command was introduced to promote the financial sustainability of open-source software. It addresses the common challenge of funding open-source projects by providing a convenient way for developers to discover and support the maintainers of their dependencies.
Originally, support for funding was often scattered and inconsistent. With the introduction of the 'funding' field in `package.json`, and the associated tooling like `npm fund`, npm formalized the process and made it easier for maintainers to express their funding needs.

SEE ALSO

npm(1), package.json(5)

Copied to clipboard