NPM.Funding (NPM v0.6.0)

Copy Markdown View Source

Parses the funding field from package.json.

Supports all npm funding formats: string URL, object with url/type, and array of funders.

Summary

Functions

Extracts funding entries from package.json data.

Counts packages with funding across a set.

Checks if a package has funding info.

Returns funding types used (github, opencollective, etc.).

Returns all funding URLs.

Functions

extract(arg1)

@spec extract(map()) :: [map()]

Extracts funding entries from package.json data.

funding_stats(packages)

@spec funding_stats([map()]) :: map()

Counts packages with funding across a set.

has_funding?(data)

@spec has_funding?(map()) :: boolean()

Checks if a package has funding info.

types(data)

@spec types(map()) :: [String.t()]

Returns funding types used (github, opencollective, etc.).

urls(data)

@spec urls(map()) :: [String.t()]

Returns all funding URLs.