title: Crating XLS file from binary data in node.js
body: <p>I received the binary data as response from http request. </p>
  
  <p>In C# I convert the data to byteArray and writhing the byteArray into file creates a readable xls file.</p>
  
  <p><strong>C# Code:</strong></p>
  
  <pre><code> HttpResponseMessage httpResponseMessage = _httpClient.GetAsync(endPoint).Result;
   var httpResponseByteArray = httpResponseMessage.Content.ReadAsByteArrayAsync().Result;
   File.WriteAllBytes("plateList.xls", httpResponseByteArray);
  </code></pre>
  
  <p>I am looking for a way to implement the same thing in node js.</p>
  
  <p>I`ve tried these methods so far but each created a non-readable file:</p>
  
  <pre><code> const Excel = require('exceljs');
  </code></pre>
  
  <p><strong>First try - node.js</strong></p>
  
  <pre><code> var dataBinary = response.data;
   var workbook = new Excel.Workbook(dataBinary);
   await workbook.xlsx.writeFile("Test.xls")
           .then(function (err) {
              if (err) throw err;
              console.log('\x1b[32m%s\x1b[0m', "Create excel file successfully");
            });
  </code></pre>
  
  <p><strong>Secound try - node.js</strong></p>
  
  <pre><code> var bufferData = Buffer.from(response.data);
   var workbook = new Excel.Workbook(dataBinary);
   await workbook.xlsx.writeFile("Test.xls")
           .then(function (err) {
              if (err) throw err;
              console.log('\x1b[32m%s\x1b[0m', "Create excel file successfully");
            });
  </code></pre>
  
  <p>Other library:</p>
  
  <pre><code> const fs = require('fs');
  </code></pre>
  
  <p><strong>Third try - node.js</strong></p>
  
  <pre><code> fs.writeFileSync("Test.xls", response.data);
  </code></pre>
  
  <p><strong>Fourth try - node.js</strong></p>
  
  <pre><code> fs.writeFileSync("Test.xls",  Buffer.from(response.data));
  </code></pre>
  
  <p>And more but nothing work to me</p>