Skip to content

Instantly share code, notes, and snippets.

@yushulx
Last active October 13, 2020 03:21
Show Gist options
  • Save yushulx/bad813ad0dfa715cbed23d2e0db18e7f to your computer and use it in GitHub Desktop.
Save yushulx/bad813ad0dfa715cbed23d2e0db18e7f to your computer and use it in GitHub Desktop.
(async () => {
await barcodereader.resetRuntimeSettings();
await barcodereader.updateRuntimeSettings('coverage'); // Mode: speed, balance, coverage
try {
await barcodereader.decode(name.files[0]).then((results) => {
let txts = [];
try {
for (let i = 0; i < results.length; ++i) {
txts.push(results[i].BarcodeText);
}
let barcoderesults = txts.join(', ');
} catch (e) {
}
});
} catch (error) {
alert(error);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment