{"library":"qr.js","title":"QR Code Encoding (Legacy)","description":"qr.js is a minimalist JavaScript library designed for encoding QR codes directly within the browser or Node.js environments. Published as version 0.0.0, the package has been unmaintained since its last update in November 2015. It is notable for its pure JavaScript implementation with no external dependencies, repackaging work from a Japanese qrcode library. Despite its initial purpose and wide adoption in older projects, its lack of maintenance and critical security issues, including a repository hijacking incident, make it unsuitable for new development. Developers are strongly advised to consider modern, actively maintained alternatives for QR code generation to ensure security and compatibility.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install qr.js"],"cli":null},"imports":["const qr = require('qr.js');","const qrcode = require('qr.js');\nconst cells = qrcode('your data').modules;"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const qr = require('qr.js');\n\n// Data to encode in the QR code\nconst data = 'Hello, Checklist Day!';\n\n// Generate the QR code data structure\nconst qrcode = qr(data);\n\n// Access the QR code cells (modules)\nconst cells = qrcode.modules;\n\nconsole.log(`QR Code for: \"${data}\"`);\nconsole.log(`Version: ${qrcode.typeNumber}`);\nconsole.log(`Error Correction Level: ${qrcode.correctLevel}`);\nconsole.log(`Number of cells (rows): ${cells.length}`);\nconsole.log(`First row of cells: ${cells[0].map(cell => cell ? '██' : '  ').join('')}`);\n\n// Example: Manually printing a small part of the QR code\nfor (let r = 0; r < Math.min(5, cells.length); r++) {\n  let rowOutput = '';\n  for (let c = 0; c < Math.min(10, cells[r].length); c++) {\n    rowOutput += cells[r][c] ? '██' : '  ';\n  }\n  console.log(rowOutput);\n}","lang":"javascript","description":"This quickstart demonstrates how to use `qr.js` to encode a string into a QR code data structure and inspect its underlying cell matrix (`modules`). It then prints a small portion of the QR code's visual representation using block characters.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}