title: NPM MysqlDump and Mysql-Import , how to add option of drop table if exist , Node.js
body: <p>I'm using the mysqldump library, and mysql-import. I need to do a restore of my MySQL database, but at the time of doing it, it tells me that you cannot add duplicate files, therefore I manually put DROP TABLE IF EXIST, and it worked and overwritten the database, according to In the Mysqldump documentation there is a way to add the DROP TABLE by default, but I really don't know how to do it, can someone help me?</p>
  <pre><code>var mysqldump = require('mysqldump');
  const controller = {};
  
  
  controller.backupDatabase = function(req, res, next) {
    if(mysqldump){
        mysqldump({
            connection: {
                host: 'localhost',
                user: 'root',
                password: '',
                database: 'decoracionesalves',
            },
            dumpToFile: './DecoracionesAlves.sql',
        });
      
    }else{
        //Hacer algo aqui.
    }
  </code></pre>
  <p>};</p>
  <pre><code>module.exports = controller;
  </code></pre>