title: how to use the imagemin buffer function
body: <p>I'm trying to use the imagemin buffer function:
  <a href="https://github.com/imagemin/imagemin" rel="nofollow noreferrer">https://github.com/imagemin/imagemin</a></p>
  
  <pre><code> file.on('data', function (d) {
     fileBuffer = Buffer.concat([fileBuffer, d]);
   }).on('end', function () {
     imagemin.buffer(fileBuffer, {
         plugins: [
            imageminMozjpeg(),
            imageminPngquant({quality: '80'})
         ]
       }).then(function (file) {
         console.log(file);
       }, function (err) {
         console.dir(err);
       });
  </code></pre>
  
  <p>for some reason its not working. does anyone know why?</p>