title: Import Database to JS file
body: <p>I am working on electron js application and pouchdb<br>
  i want to import the created database to another js file and want to retrieve the data</p>
  <p>Here is a File structure</p>
  <pre><code> -JS
      - impotdb.js        // want to import db here
  
   -DB                    // this folder contains all db
      -DB1
      -DB2
  
    db.js                //this is main db.js file where db is created 
  </code></pre>
  <p>here is db.js code</p>
  <pre><code>var PouchDB = require(&quot;pouchdb&quot;);
  var db = new PouchDB(&quot;DB/Db1&quot;, { adapter: &quot;leveldb&quot; });
  console.log(&quot;Database created Successfully.&quot;);
  </code></pre>
  <p>i tried with <a href="https://github.com/pouchdb-community/pouchdb-all-dbs" rel="nofollow noreferrer">pouchdb-all-dbs</a> plugin but for me it returned as empty array</p>
  <p>code for plugin in importdb.js file</p>
  <pre><code>var PouchDB = require(&quot;pouchdb&quot;);
  require('pouchdb-all-dbs')(PouchDB);
  
  PouchDB.allDbs().then(function (dbs) {
     // dbs is an array of strings, e.g. ['mydb1', 'mydb2']
      console.log(dbs)
    }).catch(function (err) {
      // handle err
      console.log(err)
  });
  </code></pre>
  <p>on console log dbs it returned as empty array <br>
  can any one help me to import and  use created dbs in importdb.js</p>