Function packBuffers

  • Packs an array of buffers into a single buffer.

    Parameters

    • buffers: Buffer[]

    Returns Buffer

    A buffer containing the packed buffers.

    Example

    const bufferA = Buffer.from('Hello');
    const bufferB = Buffer.from('World');
    const packedBuffers = packBuffers([bufferA, bufferB]);
    console.log(packedBuffers.toString('hex')); // 010548656c6c6f05576f726c64