Use node-qrcode in the Browser
masterYou can use node-qrcode in the browser via module bundlers (Webpack, Browserify) or by including the precompiled bundle from the build/ folder. The toCanvas method is commonly used to render the QR code onto an HTML <canvas> element.
// Using a precompiled bundle
<canvas id="canvas"></canvas>
<script src="/build/qrcode.js"></script>
<script>
QRCode.toCanvas(document.getElementById('canvas'), 'sample text', function (error) {
if (error) console.error(error)
console.log('success!');
})
</script>