alexeyten / qr-image

Yet another QR code generator
MIT License
1.05k stars 168 forks source link
javascript qr qrcode

qr-image

npm version

This is yet another QR Code generator.

Overview

Releases

Installing

npm install qr-image

Usage

Example:

var qr = require('qr-image');

var qr_svg = qr.image('I love QR!', { type: 'svg' });
qr_svg.pipe(require('fs').createWriteStream('i_love_qr.svg'));

var svg_string = qr.imageSync('I love QR!', { type: 'svg' });

Example For generate images in client side:

var qr = require('qr-image');
router.get('/qr', function(){
  var code = qr.image('http://www.google.com', { type: 'png' });
  res.setHeader('Content-type', 'image/png');  //sent qr image to client side
  code.pipe(res);
});

then in the html files:

<img src="https://github.com/alexeyten/qr-image/raw/master/qr" alt="qrcode">

More examples

qr = require('qr-image')

Methods

Options

Changes

TODO