JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://rawgit.com/agershun/alasql/develop/dist/alasql.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.8.0/xlsx.full.min.js"></script>
<input id="readfile" type="file" onchange="loadFile(event)"/>
<xmp id="output"></xmp>
JavaScript
print('AlaSQL v'+alasql.version)
print('Please upload txt, json, csv, tsv, tab, xlsx, xls or html file to see the content')
loadFile = function(event) {
alasql('SELECT * FROM FILE(?,{headers:true})',[event],function(data){
print(data)
});
}
function print(x){
document.getElementById('output').textContent += JSON.stringify(x, null, '\t')+"\n";
}