encode = async (obj = {}) => {
    let { data = null, command = [], folder = [], isStrict = false } = obj;
    await initModule();
    return new Promise((resolve, reject) => {
      let resolved = false;
      let err = "";

      gifsicle_c({
        stdout: _io.stdout,
        // stderr: _io.stderr,
        stderr: (char) => {
          err += String.fromCharCode(char);
          if (char === 10) {
            console.error(err);
            if (isStrict) {
              reject(err);
            }
          }
        },
        arguments: command,
        // input: new Uint8Array(image.buffer),
        input: data,
        folder: folder,
        output: (res) => {
          resolve(res);
          resolved = true;
        },
      }).then(() => {
        (0, _io.flush)();

        if (!resolved) {
          reject();
        }

        resetModule();
      });
    });
  }
Encode an input image using Gifsicle

@async
@param {Buffer} data Image input buffer
@param {EncodeOptions} command
@returns {Buffer} Processed image buffer