src/index.js
function zip(contentsZip, publicKey, signature) {
  debug(`zip(): start`);
  return new Promise((res, rej) => {
    const output = new streamBuffers.WritableStreamBuffer();
    const zipFile = new ZipFile();
    output.on("finish", () => {
      debug(`zip(): output finish event`);
      res(output.getContents());
    });
    zipFile.outputStream.pipe(output);
    zipFile.addBuffer(contentsZip, "contents.zip");
    zipFile.addBuffer(publicKey, "PUBKEY");
    zipFile.addBuffer(signature, "SIGNATURE");
    zipFile.end(finalSize => {
      debug(`zip(): ZipFile end event: finalSize ${finalSize} bytes`);
    });
  });
}
function zip(contentsZip, publicKey, signature) {
  debug(`zip(): start`);
  return new Promise((res, rej) => {
    const output = new streamBuffers.WritableStreamBuffer();
    const zipFile = new ZipFile();
    output.on("finish", () => {
      debug(`zip(): output finish event`);
      res(output.getContents());
    });
    zipFile.outputStream.pipe(output);
    zipFile.addBuffer(contentsZip, "contents.zip");
    zipFile.addBuffer(publicKey, "PUBKEY");
    zipFile.addBuffer(signature, "SIGNATURE");
    zipFile.end(finalSize => {
      debug(`zip(): ZipFile end event: finalSize ${finalSize} bytes`);
    });
  });
}
function zip ( contentsZip , publicKey , signature ) { debug ( ` ` ) ; return new Promise ( ( res , rej ) => { const output = new streamBuffers . WritableStreamBuffer ( ) ; const zipFile = new ZipFile ( ) ; output . on ( "finish" , ( ) => { debug ( ` ` ) ; res ( output . getContents ( ) ) ; } ) ; zipFile . outputStream . pipe ( output ) ; zipFile . addBuffer ( contentsZip , "contents.zip" ) ; zipFile . addBuffer ( publicKey , "PUBKEY" ) ; zipFile . addBuffer ( signature , "SIGNATURE" ) ; zipFile . end ( finalSize => { debug ( ` ${ finalSize } ` ) ; } ) ; } ) ; }
Create plugin.zip

@param {!Buffer} contentsZip
@param {!Buffer} publicKey
@param {!Buffer} signature
@return {!Promise<!Buffer>}
Create plugin . zip