function downloadScreenshot()

in lib/downloadAllSessionScreenshots.js [102:118]


function downloadScreenshot(url, dest, cb) {
  const out = fs.createWriteStream(dest);

  out.on('error', (err) => {
    cb(err);
    console.error(`An error occurred while downloading a screenshot to ${dest}`);
  });

  out.on('finish', (err) => {
    cb();
    out.close();      
  });

  https.get(url, (response) => {
    response.pipe(out);
  });
}