This RFC identifies an initial means of tooling to describe & notify consumers of a package's monetary support information. npm
has been vocal about our commitment to providing a means for package maintainers to more sustainably support their work & this reflects an initial step toward that goal.
Package maintainers want to clearly indentify how their software is currently, or could be in the future, supported monetarily.
- See Prior Art
- Provide a means to reference existing funding opportunities in
package.json
- Provide a means to define the type of funding opportunities in
package.json
- Provide a means to notify package consumers of funding opportunites with the cli
- Provide a means to view dependency's funding opportunites with the cli
- Provide a means to view a package's funding opportunites
- Rationale:
- This is a straightforward and easily implemented solution to take the first step toward supporting Open Source Package Maintainence sustainability
- Building this functionality into the package management layer is the only reliable way to push funding notifications to the vast majority of developers who already use npm
- Alternatives:
- Continue to rely on third-party, opt-in, tools & platforms that only support a fraction of the desired audience
- Continue debating a larger, more complex schema /w correspondingly more complex tooling
- Add a
funding
field topackage.json
- supports a string or an object with a specified
type
&url
field url
is required fornpm fund
to executetype
is an optional field that can be inferred by theurl
- Note: if
funding
is defined as a string, that value will be mapped tourl
& atype
may be inferred - Note: it is not advised to add arbitrary key/values to
funding
as additional fields may be added in the future
- supports a string or an object with a specified
- Add notification at the end of output of package installation that references the number of packages with
funding
defined- ex.
23 packages are looking for funding. Run "npm fund" to find out more.
- ex.
- Add
--no-fund
flag to opt-out of the funding notification when installing - Add
npm fund <pkg>
subcommand:- if a package is specified, npm will attempt to open the
url
defined infunding
using the--browser
config param (similar tonpm repo <pkg>
) - if no package is specified,
npm
will print out a tree of all thefunding
references defined in the current project's installed dependencies
- if a package is specified, npm will attempt to open the
- Add a visual representation & link for the
funding
type
&url
fields of a package onnpmjs.com
Examples of funding
usage in package.json
:
{
...
"funding": {
"type": "patreon",
"url": "https://www.patreon.com/my-account"
},
...
}
{
...
"funding": {
"type": "foundation",
"url": "https://openjsf.org/"
},
...
}
{
...
"funding": {
"type": "corporation",
"url": "https://microsoft.com/"
},
...
}
Example of npm fund <pkg>
:
$ npm fund example-package
# opens a browser with correpsonding `url` value: https://www.patreon.com/example-package
$ npm fund
└─ [email protected]
├─ type: patreon
└─ url: https://www.patreon.com/example-dependency
└─ [email protected]
├─ type: opencollective
└─ url: https://opencollective.com/example-dependency-two
└─ [email protected], [email protected], [email protected]
├─ type: individual
└─ url: https://sindresorhus.com/donate
- Open Collective
- GitHub Sponsors
- License Zero
- GitCoin
- Feross:
thanks
- Feross:
funding
- Indieweb: payment
- microformats:
rel-payment
- Shields.io: Funding
- ThanksApp: Donate Spec
- Bevry:
sponsored
- OGAG:
civic.json
- PM WG: "Document support levels" Draft
- PM WG: "Document support levels" Blog post to announce
- PM WG: "Document support levels" Blog post to validate
- PM WG:
support
fieldlicense
Issue - PM WG: "Future direction of
support
field" Issue - npm:
sustainability
PR - npm:
support
PR thanks
: "Read URL frompackage.json
" Issuefunding
: "Collaborate with the PM WG" Issue- Differences between: "author", "contributors", "maintainers" & "owner"