nimiq / qr-scanner

Lightweight Javascript QR Code Scanner
https://nimiq.github.io/qr-scanner/demo
MIT License
2.35k stars 509 forks source link

Node support? #215

Open AshuInsideOut opened 1 year ago

AshuInsideOut commented 1 year ago

How can I make this work on Node env? Because right now I get an error ReferenceError: window is not defined and ReferenceError: Worker is not defined.

wtatum commented 1 year ago

Looking at this myself and paging through the source it seems like a small subset (basically scanImage?) could work in Node but would need a lot of modifications to the code. The QrEngine automatically attaches a lot of event listeners, starts web workers, etc so basically none of the plumbing will work in Node but the core logic of it seems possible?

abilovelchin commented 7 months ago

Same problem

ReferenceError: Worker is not defined