Package Exports
- node-qr-image-v2
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-qr-image-v2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-qr-image
#####THIS REPO IS BESED ON alexeyten/qr-image
#####DIFFERENCES:
- change
sizeoption to image'swidth||height. - remove
marginoption.
This is yet another QR Code generator.
Overview
- No dependecies;
- generate image in
png,svg,epsandpdfformats; - numeric and alphanumeric modes;
- support UTF-8.
Installing
npm install node-qr-imageUsage
Example:
var qr = require('node-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('node-qr-image')
Methods
qr.image(text, [ec_level | options])— Readable stream with image data;qr.imageSync(text, [ec_level | options])— string with image data. (Buffer forpng);qr.svgObject(text, [ec_level | options])— object with SVG path and size;qr.matrix(text, [ec_level])— 2D array.
Options
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 IMAGE's width or height in pixels. Default100for 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.
Changes
- Implement
imageSyncforpng.
TODO
- Tests;
- mixing modes;
- Kanji (???).