src/create-contents-zip.js
function createContentsZip(pluginDir, manifest) {
  return new Promise((res, rej) => {
    const output = new streamBuffers.WritableStreamBuffer();
    const zipFile = new ZipFile();
    let size = null;
    output.on("finish", () => {
      debug(`plugin.zip: ${size} bytes`);
      res(output.getContents());
    });
    zipFile.outputStream.pipe(output);
    sourceList(manifest).forEach(src => {
      zipFile.addFile(path.join(pluginDir, src), src);
    });
    zipFile.end(finalSize => {
      size = finalSize;
    });
  });
}
function createContentsZip(pluginDir, manifest) {
  return new Promise((res, rej) => {
    const output = new streamBuffers.WritableStreamBuffer();
    const zipFile = new ZipFile();
    let size = null;
    output.on("finish", () => {
      debug(`plugin.zip: ${size} bytes`);
      res(output.getContents());
    });
    zipFile.outputStream.pipe(output);
    sourceList(manifest).forEach(src => {
      zipFile.addFile(path.join(pluginDir, src), src);
    });
    zipFile.end(finalSize => {
      size = finalSize;
    });
  });
}
function createContentsZip ( pluginDir , manifest ) { return new Promise ( ( res , rej ) => { const output = new streamBuffers . WritableStreamBuffer ( ) ; const zipFile = new ZipFile ( ) ; let size = null ; output . on ( "finish" , ( ) => { debug ( ` ${ size } ` ) ; res ( output . getContents ( ) ) ; } ) ; zipFile . outputStream . pipe ( output ) ; sourceList ( manifest ) . forEach ( src => { zipFile . addFile ( path . join ( pluginDir , src ) , src ) ; } ) ; zipFile . end ( finalSize => { size = finalSize ; } ) ; } ) ; }
Create a zipped contents

@param {string} pluginDir
@param {!Object} manifest
@return {!Promise<!Buffer>}
Create a zipped contents