Skip to content

Commit 93883bb

Browse files
authored
docs: Improve manpage section for package.json funding properties (#7582)
Small doc fix. Reviewing the section on `funding` on docs.npmjs.com, I noticed some odd code-block formatting, as well as some opportunities to clarify. The current weirdness: ![2024-06-02-214100_3840x2160_scrot](https://github.com/npm/cli/assets/205760/5f0a436f-5812-4a97-b4b9-b4183219d4dd) Glad to see string-or-object worked out.
1 parent 92e71e6 commit 93883bb

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

docs/lib/content/configuring-npm/package-json.md

+18-6
Original file line numberDiff line numberDiff line change
@@ -225,23 +225,35 @@ npm also sets a top-level "maintainers" field with your npm user info.
225225
### funding
226226

227227
You can specify an object containing a URL that provides up-to-date
228-
information about ways to help fund development of your package, or a
229-
string URL, or an array of these:
228+
information about ways to help fund development of your package, a
229+
string URL, or an array of objects and string URLs:
230230

231231
```json
232232
{
233233
"funding": {
234234
"type" : "individual",
235235
"url" : "http://example.com/donate"
236-
},
236+
}
237+
}
238+
```
237239

240+
```json
241+
{
238242
"funding": {
239243
"type" : "patreon",
240244
"url" : "https://www.patreon.com/my-account"
241-
},
245+
}
246+
}
247+
```
242248

243-
"funding": "http://example.com/donate",
249+
```json
250+
{
251+
"funding": "http://example.com/donate"
252+
}
253+
```
244254

255+
```json
256+
{
245257
"funding": [
246258
{
247259
"type" : "individual",
@@ -258,7 +270,7 @@ string URL, or an array of these:
258270

259271
Users can use the `npm fund` subcommand to list the `funding` URLs of all
260272
dependencies of their project, direct and indirect. A shortcut to visit
261-
each funding url is also available when providing the project name such as:
273+
each funding URL is also available when providing the project name such as:
262274
`npm fund <projectname>` (when there are multiple URLs, the first one will
263275
be visited)
264276

0 commit comments

Comments
 (0)