Module: services/downloads

Methods

(inner) renderDownloadsBadge(attrs) → {object}

Handles rendering concerns of badges that display download counts, with override/customization support

Parameters:
Name Type Description
attrs object

Refer to individual attrs

Properties
Name Type Attributes Description
downloads number

Number of downloads

interval string <optional>

Period or interval the downloads occurred (e.g. day, week, month). If provided then this Will be reflected in the badge message unless overridden by other message-related parameters

version string <optional>

Version or tag that was downloaded which will be reflected in the badge label (unless the label is overridden)

labelOverride string <optional>

If provided then the badge label is set to this value overriding any other label-related parameters

colorOverride string <optional>

If provided then the badge color is set to this value instead of the color being based on the count of downloads

messageSuffixOverride string <optional>

If provided then the badge message will will have this value added to the download count, separated with a space

versionedLabelPrefix string <optional>

If provided then the badge label will use this value as the prefix for versioned badges, e.g. foobar@v1.23. Defaults to 'downloads'

Source:
Returns:

Badge

Type
object