Skip to content

matthewmueller/qr-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qr-code

Generate QR codes. Based on Kazuhiko Arase's implementation.

QR

Installation

$ component install matthewmueller/qr-code

Example

var qr = require('qr-code');
var dataURI = qr('Hello!');
var img = new Image();
img.src = dataURI;
document.body.appendChild(img);

API

QR(text, options)

Create a QR code containing the given text. The result is a dataURI that you can place in an image or background. QR also takes some options including:

  • type: QR code type. Changes the amount of information you can store in the QR code (ie. density). Defaults to 4.
  • level: Backup level. See QR code error correction. Defaults to M
  • size: Size of the QR code. Defaults to 4.
  • margin: Whitespace around the outside of the image. Defaults to 0.

TODO

  • size should be based on pixels not some arbitrary number.

License

MIT

About

Create QR codes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published