node-qrcode
v0.0.4
Published
generate qrcode by nodejs but not depend on node-canvas.
Downloads
256
Readme
node-qrcode
generate qrcode by node.js but not depend on node-canvas.
why
Because of the deep dependency, qrcode is too hard to use.
qrcode's dependency: qrcode -> node-canvas -> node -> Cairo -> x11
.
So the node-qrcode is dependent on browser(webdriver/phantomjs) to draw qrcode canvas, It is very easy to use :)
Usage:
tnpm i node-qrcode --save
var qrcode = require('node-qrcode');
qrcode({
text: 'http://weibo.com',
size: 200,
qrcodePath: './qrcode.png',
browser: 'chrome'
}).then(function(qrcodePath) {
console.log(qrcodePath); // balabala/node-qrcode/qrcode.png
});
API
qrcode(option)
option.text
: required, the qrcode contentoption.size
: option, default 150, qrcode sizeoption.qrcodePath
: required, save the qrcode pngoption.browser
: option, default phanpmjs, values: chrome/phantomjs, chrome is faster but not support linux
License
MIT © 2015 sobear