npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

qrstuv

v0.2.3

Published

A clean and modern QR code reader for browsers

Readme

qrstuv

A clean and modern QR code reader for browsers. Uses Promises for returning results, rather than callbacks (Node-style or otherwise).

2011 Lazar Laszlo http://lazarsoft.info 2014 Jess Telford http://jes.st 2016 Stuart P. Bentley https://stuartpb.com/

This is a fork of a port to npm of Lazar Laszlo's port of ZXing qrcode scanner, http://code.google.com/p/zxing.

Lazar's demo exhibits basically the same functionality as this module: http://webqr.com

Prerequisites

Note that, as this library uses Promises, if you're supporting an environment that doesn't provide a native Promise implementation, you'll need to include a polyfill that provides Promise like es6-shim (for browsers) or a module that implements Promise like bluebird (for Node/Browserify).

If you're in a sandboxed module environment like Node, you'll need to explicitly introduce your Promise module to this one:

var qrcode = require('qrstuv');
qrcode.Promise = require('bluebird');

Of course, if you're using Node 4.0.0 or later, or a reasonably recent version of Google Chrome or Mozilla Firefox, you don't have to worry about this, since Promise is in the environment by default in all of these. Polyfilling promise is, essentially, a legacy concern in 2016.

Usage

qrcode = require('qrstuv');
qrcode.decode(uri).then(function(result) {
  console.log(result); // Will output the decoded information
});

If uri is not passed, will instead extract image data from a canvas element with id="qr-canvas"

[new from 2014.01.09] For webcam qrcode decoding (included in the test.html) you will need a browser with getUserMedia (WebRTC) capability.

Usage on Node

Since Node doesn't come with an implementation of Canvas or Image the way that browsers do, you'll need to introduce your own. You can do this relatively easily by installing the canvas module, which comes with both:

var qrcode = require('qrstuv');
var Canvas = require('canvas');
qrcode.Canvas = Canvas;
qrcode.Image = Canvas.Image;

qrcode.decode(__dirname + '/qrcode.png').then(function(result) {
  console.log(result);
}