const defaultOptions = {
    ast: false
};

export default (userOptions) => (input) => {
    return function babel(log) {
        const pify = require('pify');
        const babelTransform = pify(require('babel-core').transform);

        return Promise.all(
            input.map(file => {
                const options = {
                    ...defaultOptions,
                    inputSourceMap: file.map,
                    ...userOptions,
                    filename: file.path
                };

                return babelTransform(file.data, options).then(result => {
                    log(file);

                    return {
                        path: file.path,
                        data: result.code,
                        map: result.map
                    };
                });
            })
        );
    };
};

@@ -119,46 +119,8 @@
 ) %7B%0A
-        const pify = require('pify');%0A
     
@@ -150,13 +150,8 @@
 m = 
-pify(
 requ
@@ -172,17 +172,22 @@
 e').
-t
+babelT
 ransform
 );%0A%0A
@@ -182,17 +182,16 @@
 ransform
-)
 ;%0A%0A     
@@ -204,32 +204,68 @@
 urn 
+new 
 Promise
-.all(%0A           
+((resolve, reject) =%3E %7B%0A            const files =
  inp
@@ -516,95 +516,105 @@
     
-return babelTransform(file.data, options).then(result =%3E %7B%0A                    log(file
+let result;%0A%0A                try %7B%0A                    result = babelTransform(file.data, options
 );%0A%0A
@@ -806,18 +806,81 @@
        %7D
-);
+ catch (err) %7B%0A                    reject(err);%0A                %7D
 %0A       
@@ -886,16 +886,18 @@
       %7D)
+;%0A
 %0A       
@@ -897,16 +897,45 @@
         
+    resolve(files);%0A        %7D
 );%0A    %7D

`babel.transform` is sync