Socket
Socket
Sign inDemoInstall

qrcode-terminal

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qrcode-terminal - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

test/main.js

2

example/basic.js
var foo = require('../lib/main');
foo.render('this is the bomb');
foo.generate('this is the bomb');

@@ -6,5 +6,3 @@ var QRCode = require('./../vendor/qrcode'),

module.exports = {
render: function (text) {
//HACK: the two is QRErrorCorrectLevel.H
generate: function (text, cb) {
var qrcode = new QRCode(-1, QRErrorCorrectLevel.H);

@@ -14,22 +12,25 @@ qrcode.addData(text);

var border = new Array(qrcode.getModuleCount() + 3).join(' ').white.inverse + "\n",
output = "";
var border = new Array(qrcode.getModuleCount() + 3).join(' ').white.inverse;
console.log(border);
output += border;
for (var row = 0; row < qrcode.getModuleCount(); row++) {
var str = " ".white.inverse;
output += " ".white.inverse;
for (var col = 0; col < qrcode.getModuleCount(); col++) {
if (qrcode.isDark(row, col)) {
str += " ";
output += " ";
}
else {
str += " ".white.inverse;
output += " ".white.inverse;
}
}
str += " ".white.inverse;
console.log(str);
output += " ".white.inverse + "\n";
}
console.log(border);
output += border;
if (cb) cb(output);
else console.log(output);
}
};
{
"name": "qrcode-terminal",
"keywords": ["ansi", "ascii", "qrcode", "console"],
"version" : "0.3.0",
"version" : "0.4.0",
"description" : "QRCodes, in the terminal",
"homepage": "https://github.com/gtanner/qrcode-terminal",
"repository": {
"type": "git",
"url": "https://github.com/gtanner/qrcode-terminal"
},
"contributors": [{

@@ -22,3 +26,11 @@ "name": "Gord Tanner",

"colors": "*"
},
"devDependencies": {
"sinon": "*",
"mocha": "*",
"expect.js": "*"
},
"scripts": {
"test": "node example/basic.js && ./node_modules/mocha/bin/mocha -R nyan"
}
}

@@ -18,4 +18,14 @@ # QRCode Terminal Edition

qrcode.render("This will be a QRCode Eh!");
qrcode.generate("This will be a QRCode Eh!");
If you don't want to display to the terminal but just want to string you can provide a callback:
qrcode.generate("http://www.github.com", function (qrcode) { });
# Developing
To setup the development envrionment run `npm install`
To run tests run `npm test`
# Contributers:

@@ -22,0 +32,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc