Formatting utilities for npm CLI output.
Shared formatting functions used across Mix tasks for consistent output.
Summary
Functions
Format a byte size into human-readable string.
Format a duration in microseconds.
Format a package name and version.
Pluralize a word based on count.
Truncate a string to a maximum length.
Functions
@spec bytes(non_neg_integer()) :: String.t()
Format a byte size into human-readable string.
@spec duration(non_neg_integer()) :: String.t()
Format a duration in microseconds.
Format a package name and version.
@spec pluralize(non_neg_integer(), String.t(), String.t()) :: String.t()
Pluralize a word based on count.
@spec truncate(String.t(), non_neg_integer()) :: String.t()
Truncate a string to a maximum length.