basic setup

This commit is contained in:
Robin Appelman 2019-12-04 23:08:26 +01:00
commit ccbf5edad0
6 changed files with 753 additions and 37 deletions

View file

@ -1 +1,22 @@
import("../pkg/index.js").catch(console.error);
import("../pkg/index.js")
.then(m => {
document.getElementById('file').onchange = e => {
let file = e.target.files[0];
let reader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onload = function() {
console.log(reader.result);
let bytes = new Uint8Array(reader.result);
m.parse_demo(bytes);
};
reader.onerror = function() {
console.log(reader.error);
};
};
})
.catch(console.error);