How to use the pretty-bytes/index function in pretty-bytes

To help you get started, we’ve selected a few pretty-bytes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tunepack / tunepack-desktop / src / renderer / components / ResultListItemControls / ResultListItemControls.js View on Github external
if (download?.get('isDownloading')) {
    const avgSpeed = download.get('avgSpeed')

    return (
      <div>
        <div>
          <div style="{{">
        </div>
        {avgSpeed ? (
          <div>
            {prettyBytes(avgSpeed)}/s
          </div>
        ) : (
          <div>
            starting...
          </div>
        )}
      </div>
    )
  }

  return (
    </div>

pretty-bytes

Convert bytes to a human readable string: 1337 → 1.34 kB

MIT
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis

Popular pretty-bytes functions