UNPKG

bytes-formatter

Version:

Bytes formatter module provides a function to format byte values into human-readable strings with appropriate units (bytes, KB, MB, GB, TB, PB).

9 lines (7 loc) 249 B
// typescript /** * Formats given <code>bytes</code> to human friendly format. * @param {number} bytes The bytes to be formatted. * @return {string} The formatted bytes as string. */ export declare function formatBytes(bytes: number): string;