Skip to content

generate qrcode by node.js but not depend on node-canvas.

License

Notifications You must be signed in to change notification settings

imsobear/node-qrcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

generate qrcode by node.js but not depend on node-canvas.

Resources

License

Stars

Watchers

Forks

Packages

No packages published