src/browserify.js
function (stream, destPath) {
    let data = '';
    return new Promise(function (resolve, reject) {
        stream.on('error', reject);
        stream.on('data', function (d) {
            data += d.toString();
        });
        stream.on('end', function () {
            fs.outputFile(destPath, data, function (err) {
                if (!err) {
                    resolve();
                } else {
                    reject(err);
                }
            });
        });
    });
}
function (stream, destPath) {
    let data = '';
    return new Promise(function (resolve, reject) {
        stream.on('error', reject);
        stream.on('data', function (d) {
            data += d.toString();
        });
        stream.on('end', function () {
            fs.outputFile(destPath, data, function (err) {
                if (!err) {
                    resolve();
                } else {
                    reject(err);
                }
            });
        });
    });
}
function ( stream , destPath ) { let data = '' ; return new Promise ( function ( resolve , reject ) { stream . on ( 'error' , reject ) ; stream . on ( 'data' , function ( d ) { data += d . toString ( ) ; } ) ; stream . on ( 'end' , function ( ) { fs . outputFile ( destPath , data , function ( err ) { if ( ! err ) { resolve ( ) ; } else { reject ( err ) ; } } ) ; } ) ; } ) ; }
Handles writing the browserify bundle stream to the destination file.
@param {EventEmitter} stream - The bundle stream
@param {string} destPath - The destination file
@private
Handles writing the browserify bundle stream to the destination file .