Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "bytes"

Bytes

Transform bytes number to readable string.

import { bytes } from '@mochen/yuumi';

Index

Functions

Functions

Const format

  • format(bytes: number, decimals?: number, kib?: boolean): string
  • Transform bytes to readable string.

    example
    bytes.format(1020) // 1.02 KB
    bytes.format(1100, 1) // 1.1 KB
    bytes.format(1024, 2, true) // 1Kib

    Parameters

    • bytes: number
    • Default value decimals: number = 2
    • Default value kib: boolean = false

    Returns string

Generated using TypeDoc