index.js 369 B

1234567891011121314151617
  1. var QRCode = require('./lib/QRCode');
  2. var ErrorCorrectLevel = require('./lib/ErrorCorrectLevel');
  3. var qrcode = function(data, opt) {
  4. opt = opt || {};
  5. var qr = new QRCode(opt.typeNumber || -1,
  6. opt.errorCorrectLevel || ErrorCorrectLevel.H);
  7. qr.addData(data);
  8. qr.make();
  9. return qr;
  10. };
  11. qrcode.ErrorCorrectLevel = ErrorCorrectLevel;
  12. module.exports = qrcode;