{"library":"qrcode-generator","title":"QR Code Generator for JavaScript","description":"qrcode-generator is a robust, pure JavaScript implementation for generating QR codes, supporting a wide range of features including various error correction levels (L, M, Q, H), different data encoding modes (Numeric, Alphanumeric, Byte, Kanji), and output formats (HTML Image Tag, SVG, Canvas, ASCII, Data URL). It is based on the JIS X 0510:1999 standard. The current stable version is 2.0.4, released in April 2024, with releases occurring periodically to address issues and add features like module support and TypeScript types in recent major versions. Key differentiators include its lightweight nature, direct HTML rendering capabilities, and foundational adherence to the QR Code specification, making it suitable for both browser and Node.js environments without external dependencies.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install qrcode-generator"],"cli":null},"imports":["import qrcode from 'qrcode-generator';","const qrcode = require('qrcode-generator');","import type { QRCode } from 'qrcode-generator';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import qrcode from 'qrcode-generator';\n\n// Configuration for QR Code\nconst typeNumber = 4; // Type number (1-40), or 0 for auto-detection\nconst errorCorrectionLevel = 'M'; // Error correction level ('L', 'M', 'Q', 'H')\nconst dataToEncode = 'Hello, Checklist Day! This is a test QR code generated using qrcode-generator in a modern JavaScript environment.';\n\n// Create a QR Code instance\nconst qr = qrcode(typeNumber, errorCorrectionLevel);\n\n// Add data to the QR Code\nqr.addData(dataToEncode);\n\n// Make the QR Code (generate the matrix)\nqr.make();\n\n// Render the QR Code to an SVG string (Node.js example)\nconst svgString = qr.createSvgTag(5, 5); // cellSize = 5, margin = 5\n\nconsole.log('Generated SVG for QR Code:\\n', svgString);\n\n// Example for browser environment (hypothetical DOM interaction)\n// If running in a browser, you might append this to a DOM element:\n// document.getElementById('qr-container').innerHTML = qr.createImgTag(4, 4, 'My QR Code');","lang":"typescript","description":"This example demonstrates how to import the `qrcode` factory function, configure a QR code, add data, generate the code matrix, and then render it as an SVG string, suitable for both Node.js console output or browser DOM manipulation.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}