Formatters-related utility methods.
Methods
(static) formatBytes(bytes) → {string}
Formats given
bytes
to human friendly format.
Parameters:
Name | Type | Description |
---|---|---|
bytes |
number
|
The bytes to be formatted. |
Returns:
- Type:
-
string
The formatted bytes as string.
Example
formatBytes(1024); // 1.0 Kb