scannable
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

scannable

npm GitHub demo npm bundle size npm

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');

Dependencies (0)

    Dev Dependencies (23)

    Package Sidebar

    Install

    npm i scannable

    Weekly Downloads

    22

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    149 kB

    Total Files

    63

    Last publish

    Collaborators

    • leodog896