Barcode-scanner.JS is a Javascript library that provide implementation of Magnetic stripe/barcode USB and PS/2 scanners. It's detects when user use a magnetic stripe or barcode scanner, and call specific callbacks.
How it's works
At the core Barcode-scanner.JS intercepts key press events and if they occur with high frequency stores them in buffer, and then analyzes and provides the developer with the processed result. As a bonus library hides the flow of events associated with the operation of the scanner using (hiding does not lead to loss of a single control and numeric chars - library repeated event and modify input elements text).