Skip to main content

readableBytes

Converts a number of bytes to a human readable file size.

Parameters

  • bytes number of bytes to show
  • decimals number? optional number of decimals to show

Examples

readableBytes(1234);
// => 1.205078125 kB

readableBytes(1234, 2);
// => 1.21 kB

Returns string of human readable file size.

Meta

  • version: 1.0.0