title: NPM package excel-as-json fires callback early
body: <p>I am using excel-as-json NPM package to convert an excel file to json (<a href="https://www.npmjs.com/package/excel-as-json" rel="nofollow noreferrer">https://www.npmjs.com/package/excel-as-json</a>).</p>
  
  <p>As per the documentation the last parameter is the callback function. So, I wrote this:</p>
  
  <pre><code>convertExcel = require('excel-as-json').processFile;
  
  
  function fixJson(fileName){
  
      var jsonfile = require('jsonfile');
      var file = fileName;
  
      jsonfile.readFile(file, function(err, data) {
          if(err){
              console.log(err);
          }
      })
  
  
  
  }
  
  convertExcel('test.xlsx', 'test.json', {sheet:"1"}, fixJson('test.json'));
  </code></pre>
  
  <p>But when I run this file through node, the callback function fixJson() fires before the conversion completes. Due to this I get an error "Unexpected end of JSON input". When I look at the JSON file, it contains the data.</p>
  
  <p>Am I doing something wrong here? or there is a problem with the callback function?</p>
  
  <p>Thanks.</p>