Convert bytes to a human readable string: 13371.34 kB.

import formatBytes from '@oliversalzburg/js-utils/format/bytes.js';

formatBytes(1337);
//=> '1.34 kB'

formatBytes(100);
//=> '100 B'

// Display file size differences
formatBytes(42, {signed: true});
//=> '+42 B'

// Localized output using German locale
formatBytes(1337, {locale: 'de'});
//=> '1,34 kB'