Discovers and aggregates funding information from installed packages.
Reads the funding field from package manifests to help users
support open source maintainers.
Summary
Functions
Collects funding info from all packages in a node_modules directory.
Extracts funding info from a package.json data map.
Groups funding entries by funding URL.
Returns a summary of funding information.
Types
Functions
@spec collect(String.t()) :: [funding_info()]
Collects funding info from all packages in a node_modules directory.
@spec extract(map()) :: [funding_info()]
Extracts funding info from a package.json data map.
The funding field can be a string (URL), a map with type and url,
or a list of such entries.
@spec group_by_url([funding_info()]) :: %{required(String.t()) => [funding_info()]}
Groups funding entries by funding URL.
@spec summary([funding_info()]) :: %{ packages_with_funding: non_neg_integer(), unique_urls: non_neg_integer(), types: [String.t()] }
Returns a summary of funding information.