Search and display node by scanning a barcode image
How to transfer the code from the barcode image to the text field on the webform upon scanning?


AFAIK most of the scanners place value into focused form element (the one with the cursor in it). So make sure that field is focused when you load the page and that should cover your first question. You can probably use contrib modules (eg. https://www.drupal.org/project/focus) to achieve it without any custom Javascript.


  and what is the best approach for performing the search among all nodes and pull out/display only the node related to the card being scanned.


I think the easiest approach is to create a View with exposed filter (barcode). Then after scanning the barcode on the plastic card, you'll be one click away from a node for an existing card.