examples/s3-backup-file.js
function createBackupFile(sourceUrl, backupTmpFilePath) {
  return new Promise((resolve, reject) => {
    couchbackup.backup(
      sourceUrl,
      fs.createWriteStream(backupTmpFilePath),
      (err) => {
        if (err) {
          return reject(new VError(err, 'CouchBackup process failed'));
        }
        debug('couchbackup to file done; uploading to S3');
        resolve('creating backup file complete');
      }
    );
  });
}
function createBackupFile(sourceUrl, backupTmpFilePath) {
  return new Promise((resolve, reject) => {
    couchbackup.backup(
      sourceUrl,
      fs.createWriteStream(backupTmpFilePath),
      (err) => {
        if (err) {
          return reject(new VError(err, 'CouchBackup process failed'));
        }
        debug('couchbackup to file done; uploading to S3');
        resolve('creating backup file complete');
      }
    );
  });
}
function createBackupFile ( sourceUrl , backupTmpFilePath ) { return new Promise ( ( resolve , reject ) => { couchbackup . backup ( sourceUrl , fs . createWriteStream ( backupTmpFilePath ) , ( err ) => { if ( err ) { return reject ( new VError ( err , 'CouchBackup process failed' ) ) ; } debug ( 'couchbackup to file done; uploading to S3' ) ; resolve ( 'creating backup file complete' ) ; } ) ; } ) ; }
Use couchbackup to create a backup of the specified database to a file path.

@param {any} sourceUrl Database URL
@param {any} backupTmpFilePath Path to write file
@returns Promise
Use couchbackup to create a backup of the specified database to a file path .