Skip to content

Commit

Permalink
docs: add webservice example in html
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Nov 11, 2022
1 parent f9abb64 commit 06f3e96
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions html/webservice.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<html>
<head>
<script src="../dist/filelist-utils.js"></script>
</head>
<body>
<script>
async function doAll() {
const fileCollection = await FileListUtil.fileCollectionFromWebservice(
'https://zakodium-oss.github.io/analysis-dataset/gcms.json',
);

for (let i = 0; i < 10; i++) {
console.log(await fileCollection.files[0].text());
console.log(await fileCollection.files[0].arrayBuffer());
await delay(5000);
}
}

function delay(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

doAll();
</script>
FileList
</body>
</html>

0 comments on commit 06f3e96

Please sign in to comment.