scannable
v1.1.0
Published
QR code generation for a modern web
Downloads
22
Readme
scannable
QR code generation for a modern web.
The core of this is from nayuki's QR code generator
TIP: If you want to try out the methods, open inspect element.
Install
npm i scannable
Deno
import { ... } from 'https://esm.sh/scannable'; // all functions are exposed!
QR Generation
import { renderCanvas, renderSVG, renderText, renderTwoTone } from 'scannable/qr';
// Render it to a canvas
renderCanvas('https://yahoo.net', coolCanvas);
// Outputs a qr code with ASCII text
const text = renderText('https://example.com');
// You can also specify options
const customText = renderText({
value: 'https://google.com',
foregroundChar: '%'
});
// You can even use unicode characters to squish text.
const unicodeText = renderTwoTone('https://leodog896.github.io/scannable');
// Or make an SVG!
const svgHTML = renderSVG('https://netflix.com');