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.
- Host: GitHub
- URL: https://github.com/imsobear/node-qrcode
- Owner: imsobear
- License: mit
- Created: 2015-12-05T19:07:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-07T08:01:56.000Z (over 9 years ago)
- Last Synced: 2025-03-24T15:01:40.713Z (3 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 --savevar 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