title: Node.js: It is possible to convert a BLOB into file and open it with default application using shell?
body: <p>using <a href="https://electronjs.org/docs/api/shell" rel="nofollow noreferrer">shell</a> we can open file by its default application. But it is possible to a <code>blob</code> that is converted into file?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var fileurl = ''; //url of a file, example is docx file.
  var filename = $(this).text().replace(/^\s+/g, '');
  
  $.ajax({
          url: fileurl,
          method: 'GET',
          xhrFields: {
              responseType: 'blob'
          },
          success: function (data) {
            //convert the blob into file
            var file = new File([data], filename, {type: data.type, lastModified: Date.now()});
            const {shell} = require('electron');
            shell.openItem(file); //open the converted file with it's default application
          }
    });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I tried to convert the blob into file thinking maybe it will work but it fail and the error says <code>Error processing argument at index 0, conversion failure from #&lt;File&gt;</code>.</p>