Skip to main content
The Deno 2 Release Candidate is here
Learn more

QRCode Terminal For Deno

deno

😎Run the Demo

deno run https://deno.land/x/qrcode_terminal/demo/demo.js

🔎Examples

import qrcode from 'https://deno.land/x/qrcode_terminal/mod.js'

console.log("\n\nScan It Skip To Google 👇\n")
qrcode.generate("https://www.google.com")

output:

demo

📃Usage

To display some data to the terminal just call:

qrcode.generate('This will be a QRCode, eh!');

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:

qrcode.generate('http://github.com', function (qrcode) {
    console.log(qrcode);
});

If you want to display small output, provide opts with small:

qrcode.generate('This will be a small QRCode, eh!', {small: true});

qrcode.generate('This will be a small QRCode, eh!', {small: true}, function (qrcode) {
    console.log(qrcode)
});

🤝Acknowledgments

Special thanks to the prior work by @gtanner in qrcode-terminal.

☕Buy me a cup of coffee

If you think the project has helped you, you can buy a cup of coffee for the author as a sign of encouragement 👇

deno run https://deno.land/x/qrcode_terminal/support/buy-me-a-cup-of-coffee.js

🔑License

MIT