node-qrcode

0.0.4 • Public • Published

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 content
  • option.size: option, default 150, qrcode size
  • option.qrcodePath: required, save the qrcode png
  • option.browser: option, default phanpmjs, values: chrome/phantomjs, chrome is faster but not support linux

License

MIT © 2015 sobear

Readme

Keywords

Package Sidebar

Install

npm i node-qrcode

Weekly Downloads

44

Version

0.0.4

License

MIT

Last publish

Collaborators

  • sobear