Badass JavaScript

A showcase of awesome JavaScript that pushes the boundaries of what's possible on the web, by @devongovett.

Barcode Scanning In JavaScript

June 1st 2010

Tobias Schneider (of Gordon fame) has written a barcode scanner in JavaScript in response to Remy Sharp’s request on Twitter (only yesterday).  It uses canvas to read the pixels from an image, and prints out the UPC code that the barcode represents.  Since JavaScript doesn’t normally have access to the webcam, its practical use is rather limited.  However, there are some places where this could be useful - such as in a PhoneGap application, and eventually we may have an API for accessing the webcam in desktop browsers.

You can check out the code on Github, and see a demo here.

Barcode image

Awesome work!