An open API service indexing awesome lists of open source software.

https://github.com/imsobear/node-qrcode

generate qrcode by node.js but not depend on node-canvas.
https://github.com/imsobear/node-qrcode

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# node-qrcode

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

## why

Because of the deep dependency, [qrcode](https://github.com/soldair/node-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