__
__ _ __ /\_\ ____
/'__`\/\`'__\ \/\ \ /',__\
/\ \L\ \ \ \/__ \ \ \/\__, `\
\ \___, \ \_\\_\_\ \ \/\____/
\/___/\ \/_//_/\ \_\ \/___/
\ \_\ \ \____/
\/_/ \/___/
[qr.js][] is a pure JavaScript library for [QR code][] generation using canvas.
* [Install](#install)
* [Examples](#examples)
* [API](#api)
* [Canvas Support](#canvas-support)
* [Bugs](#bugs)
* [Questions](#questions)
## Install
Install using the package manager for your desired environment(s):
``` bash
# for node.js:
$ npm install qr-js
# OR; for the browser:
$ bower install qr-js
```
## Examples
In the browser:
``` html
```
In [node.js][]:
``` javascript
var qr = require('qr-js');
qr.saveSync('http://neocotic.com/qr.js', 'qrcode.png');
```
## API
### Standard Data
The following configuration data options are recognised by all of the core API methods (all of
which are optional):
Property |
Description |
Default |
background |
Background colour to be used |
#fff |
canvas |
<canvas> element in which the QR code should be rendered |
Creates a new element |
foreground |
Foreground colour to be used |
#000 |
level |
ECC (error correction capacity) level to be applied |
L |
size |
Module size of the generated QR code |
4 |
value |
Value to be encoded in the generated QR code |
"" |
### `canvas([data|value])`
Renders a QR code in an HTML5 `