Socket
Socket
Sign inDemoInstall

qrcode-terminal

Package Overview
Dependencies
0
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.5 to 0.10.0

10

lib/main.js

@@ -17,4 +17,7 @@ var QRCode = require('./../vendor/QRCode'),

module.exports = {
error: QRErrorCorrectLevel.L,
generate: function (input, cb) {
var qrcode = new QRCode(-1, QRErrorCorrectLevel.H);
var qrcode = new QRCode(-1, this.error);
qrcode.addData(input);

@@ -36,3 +39,8 @@ qrcode.make();

else console.log(output);
},
setErrorLevel: function (error) {
this.error = QRErrorCorrectLevel[error] || this.error;
}
};

2

package.json
{
"name": "qrcode-terminal",
"keywords": ["ansi", "ascii", "qrcode", "console"],
"version" : "0.9.5",
"version" : "0.10.0",
"description" : "QRCodes, in the terminal",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/gtanner/qrcode-terminal",

@@ -25,2 +25,7 @@ # QRCode Terminal Edition [![Build Status][travis-ci-img]][travis-ci-url]

You can even specify the error level (default is 'L'):
qrcode.setErrorLevel('Q');
qrcode.generate('This will be a QRCode with error level Q!');
If you don't want to display to the terminal but just want to string you can provide a callback:

@@ -27,0 +32,0 @@

@@ -51,3 +51,14 @@ var expect = require('expect.js'),

});
describe('the error level', function () {
it('should default to 1', function() {
expect(qrcode.error).to.be(1);
});
it('should not allow other levels', function() {
qrcode.setErrorLevel = 'something';
expect(qrcode.error).to.be(1);
});
});
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc