js-scanner-handler

0.1.2 • Public • Published

jsScannerHandler

Small js script adding barcode/qrcode scanner custom event emulation for websites;

How does it works

Register DOM element which will react to keydown event. Best option is to use document.

new ScannerHandler.register(document);

After that add event listener to document element on scanEnd event.

document.addEventListener('scanEnd', function(e) {
  document.querySelector("#sth").innerHTML = e.detail.value;
});

Value readed by scanner will be in event.detail.value.

Package Sidebar

Install

npm i js-scanner-handler

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

4.36 kB

Total Files

4

Last publish

Collaborators

  • samlis