This is yet another QR Code generator.
- No dependecies;
- generate image in
png,svg,epsandpdfformats; - numeric and alphanumeric modes;
- support UTF-8.
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' });qr = require('qr-image')
qr.image(text, [ec_level | options])— Readable stream with image data;qr.imageSync(text, [ec_level | options])— string with image data. (not implemented forpng);qr.svgObject(text, [ec_level | options])— object with SVG path and size;qr.matrix(text, [ec_level])— 2D array.
text— text to encode;ec_level— error correction level. One ofL,M,Q,H. DefaultM.options— image options object:ec_level— defaultM.type— image type. Possible valuespng(default),svg,pdfandeps.size(png and svg only) — size of one module in pixels. Default5for png andundefinedfor svg.margin— white space around QR image in modules. Default4forpngand1for others.customize(only png) — function to customize qr bitmap before encoding to PNG.parse_url(experimental, defaultfalse) — try to optimize QR-code for URLs.
sizeoption is also used for SVG.- Add experimental
parse_urloption. First attemt to mix modes. - Fix weird bug witch CRC32 calculation on Raspberry Pi.
- Tests;
imageSyncforpng.- mixing modes;
- Kanji (???).