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 10 months ago

Package Health Score

77 / 100
Full package analysis

Popular pretty-bytes functions