title: ¿How can I manipulate data as it is being read from an xslx file with nodejs Streams?
body: <p>I need to manipulate the data inside stream.on('data') body, but I get the following error: &quot;error: Unsupported ZIP Compression method NaN stream on node&quot;. It only works when I manipulate the data inside stream.on('end') event, I'm trying to read large excel files</p>
  <pre><code>      const readStreamExcelFile = function(stream, cb) {
          const buffers = [];
  
          stream.on(&quot;data&quot;, function(data) { 
            buffers.push(data);
  
            const buffer = Buffer.concat(buffers);
            const workbook = XLSX.read(buffer, { type: &quot;buffer&quot; });
            const workbookSheets = workbook.SheetNames;
            // With this callback I do some operations with data
            cb(workbookSheets, workbook);
  
          });
  
          stream.on(&quot;end&quot;, function() {
            /* Here I can manipulate data with this
            const buffer = Buffer.concat(buffers);
            const workbook = XLSX.read(buffer, { type: &quot;buffer&quot; });
            const workbookSheets = workbook.SheetNames;
            cb(workbookSheets, workbook);
            */
            resolve();
          });
        };
  </code></pre>