/**
 *
 * @param {*} uploader
 */
function promiseWrapUploader(uploader) {
  return new Promise(function (resolve, reject) {
    uploader.on('error', reject);
    uploader.on('end', resolve);
    uploader.on('fileUploadEnd', function (localFilePath, s3Key) {
      console.log(`Pushed ${localFilePath} to ${s3Key}`);
    });
  });
}

module.exports = promiseWrapUploader;
