Options
All
  • Public
  • Public/Protected
  • All
Menu

@themezernx/yaz0lib

Index

Functions

compressYaz0

  • compressYaz0(data: Buffer, alignment?: number, level?: number): Buffer
  • Compress a buffer with Yaz0.

    Parameters

    • data: Buffer

      The buffer to compress

    • alignment: number = 0
    • level: number = 0

    Returns Buffer

    The compressed buffer

compressYaz0File

  • compressYaz0File(path: string, alignment?: number, level?: number): string
  • Read a file from a path and compress it with Yaz0.

    Parameters

    • path: string

      The filepath

    • alignment: number = 0
    • level: number = 0

    Returns string

    The output path. Filename: filename + '.compressed' + original file extension

decompressYaz0

  • decompressYaz0(data: Buffer): Buffer
  • Decompress a Yaz0 buffer.

    throws

    error Will throw an error if the data is not compressed with Yaz0

    Parameters

    • data: Buffer

      The compressed buffer

    Returns Buffer

    The decompressed buffer

decompressYaz0File

  • decompressYaz0File(path: string): string
  • Read a file from a path and decompress it with Yaz0.

    Parameters

    • path: string

      The filepath

    Returns string

    The output path. Filename: filename + '.decompressed' + original file extension

isYazCompressed

  • isYazCompressed(data: Buffer): boolean
  • Check if a buffer is a compressed with Yaz.

    Parameters

    • data: Buffer

      The buffer to check

    Returns boolean

    True if the buffer is a compressed Yaz0 file

Generated using TypeDoc