title: Filter by extension in Electron file dialog
body: <p>How do I add a filter by extension in an Electron file dialog. For example: </p>
  
  <pre><code>function openDialogExample() {
      var remote = require('remote');
      var dialog = remote.require('dialog');
  
      return dialog.showOpenDialog(
        remote.getCurrentWindow(),
        {
            defaultPath: 'c:/',
            filters: [
                { name: 'All Files', extensions: ['*'] },
                { name: 'Images', extensions: ['jpg', 'png', 'gif'] },
                { name: 'Movies', extensions: ['mkv', 'avi', 'mp4'] }
              ],
            properties: ['openFile']
        }
      );
  }
  </code></pre>
  
  <p>How do I implement it into my codebase?</p>
  
  <pre><code>const app = require('electron').remote
  const fs = require('fs')
  const dialog = app.dialog
  
  document.getElementById('importWallet').onclick = () =&gt; {
      dialog.showOpenDialog((fileName) =&gt; {
          if(fileName !== undefined) {
              readWallet(fileName[0])
          }
      });
  }
  
  function readWallet(filePath) {
      fs.readFile(filePath, 'utf-8', (err, data) =&gt; {
          if(err) {
              alert('An error occured while importing your wallet', err)
              return
          }
      })
  }
  </code></pre>