@toolsnap/qrcode-generator
v1.0.0
Published
Pure JavaScript QR code generator with SVG output
Maintainers
Readme
@toolsnap/qrcode-generator
Pure JavaScript QR code generator with SVG output. Zero dependencies.
Installation
npm install @toolsnap/qrcode-generatorUsage
const { generate, toSVG, toMatrix } = require('@toolsnap/qrcode-generator');
// Generate QR code as SVG string
const svg = generate('https://example.com');
console.log(svg);
// With options
const svg2 = toSVG('Hello World', {
size: 512,
color: '#333333',
bg: '#ffffff',
margin: 24
});
// Get raw matrix
const matrix = toMatrix('test');API
generate(data, options)- Generate QR code SVG stringtoSVG(data, options)- Alias for generatetoMatrix(data)- Get raw boolean matrix
License
MIT
