Logos DX
    Preparing search index...

    Function kilobytes

    • Creates a byte size in kilobytes.

      WHY: Provides a more readable way to specify sizes in KB.

      Parameters

      • n: number

        number of kilobytes

      Returns number

      bytes equivalent

      const maxSize = kilobytes(500);  // 500 KB = 512000 bytes
      if (buffer.length > kilobytes(100)) console.log('Buffer too large');