es5/src/create-writable.js
function createWritable() {
    var $args = arguments;return new Promise(function ($return, $error) {
        var file, ws;
        file = $args.length > 0 && $args[0] !== undefined ? $args[0] : getTempFile();
        return Promise.resolve(openFileForWrite(file)).then(function ($await_2) {
            try {
                ws = $await_2;
                return $return(ws);
            } catch ($boundEx) {
                return $error($boundEx);
            }
        }.bind(this), $error);
    }.bind(this));
}
function createWritable() {
    var $args = arguments;return new Promise(function ($return, $error) {
        var file, ws;
        file = $args.length > 0 && $args[0] !== undefined ? $args[0] : getTempFile();
        return Promise.resolve(openFileForWrite(file)).then(function ($await_2) {
            try {
                ws = $await_2;
                return $return(ws);
            } catch ($boundEx) {
                return $error($boundEx);
            }
        }.bind(this), $error);
    }.bind(this));
}
function createWritable ( ) { var $args = arguments ; return new Promise ( function ( $return , $error ) { var file , ws ; file = $args . length > 0 && $args [ 0 ] !== undefined ? $args [ 0 ] : getTempFile ( ) ; return Promise . resolve ( openFileForWrite ( file ) ) . then ( function ( $await_2 ) { try { ws = $await_2 ; return $return ( ws ) ; } catch ( $boundEx ) { return $error ( $boundEx ) ; } } . bind ( this ) , $error ) ; } . bind ( this ) ) ; }
Open the file for writing and create a write stream.
@param {string} ffile path to the file
@returns {Promise<Writable>} A promise with the stream
Open the file for writing and create a write stream .