
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
jquery-inputreader
Advanced tools
jquery-inputreader is a small library to allow batch scanning of whole barcodes or magnetic stripes from keyboard based readers. The basic principal behind these readers is that they emulate a keyboard - but they type much faster than any human would.
jquery-inputreader is a small library to allow batch scanning of whole barcodes or magnetic stripes from keyboard based readers. The basic principal behind these readers is that they emulate a keyboard - but they type much faster than any human would.
This library traps all keystrokes, and if the timeout passes, then the scan is done and an event is raised. During the event, if the pattern of the scan data matches a pattern you define, you can prevent the default action - which is to insert it into the current input box.
NOTE: This library will prevent the normal keypress/keyup behavior.
Because the default action is to insert the data at the cursor in the input box, it is best to listen for reading on the input box. However, you may also listen on other elements as well (such as document) though that would suppress keyevents for a broader scope.
While v2.0 doesn't have any API changes, there are some processing changes that could be break previous installation.
v2.0 added support for capturing some Control characters embedded in barcodes as Unicode characters - such as Arrow keys, Backspace, Delete, F1-F12. More may come. Though I'll make sure these are major version updates.
$.fn.inputreader.defaults.timeout: Specifies the timeout between keypresses (default is 50 milliseconds).
$.fn.inputreader.defaults.insertText: Allow/disallow inserting the text after the event (default is true)
listen - starts listeningstop - stops listeninginputreader:scan
This event is raised when the timeout between keys is reached. The default timeout of 50 milliseconds should be almost imperceptible to normal typing speeds.
Normal keypresses WILL trigger this event.
The scanned data (or key pressed) can be found in the scandata property of the event.
To prevent insertion used preventDefault().
$('#testInput')
.inputreader('listen')
.on('inputreader:scan', function(e) {
if (e.scandata == '12') { // your pattern here
e.preventDefault();
}
});
FAQs
jquery-inputreader is a small library to allow batch scanning of whole barcodes or magnetic stripes from keyboard based readers. The basic principal behind these readers is that they emulate a keyboard - but they type much faster than any human would.
We found that jquery-inputreader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.