Runnable snippets for each output method and main options. Output goes to examples/out/.
Run from repo root:
deno run -A examples/<name>.tsReplace <name> with any script below (e.g. basic-svg, formats).
| File | What it does |
|---|---|
| basic-svg.ts | toSVG() minimal (value + size) → basic.svg |
| colors-full.ts | Solid + background, radial gradient, radial with fx/fy → 3 SVGs |
| error-levels.ts | Error levels L, M, Q, H → error-level-L.svg … error-level-H.svg |
| finder-module.ts | Finder shape ≠ module shape (square vs circle) → finder-module.svg |
| formats.ts | toDataURL, toASCII, toTableTag → log + qr-table.html |
| logo-full.ts | Logo text+size+radius, logo image (data URI), radius cutout → 3 SVGs |
| path-and-canvas.ts | toPath → path-only.html; toCanvas → canvas-qr.html (open in browser) |
| png.ts | toPNG() data URL → decode and write qr-default.png, qr-colored.png |
| shapes-all.ts | All 7 module shapes → shapes-rounded.svg … shapes-triangle.svg |
| shapes-and-colors.ts | Rounded/circle, linear gradient, logo text → 4 SVGs |
| svg-a11y.ts | toSVG() with title/alt → svg-a11y.svg (role, <title>, ) |
| to-file-stream.ts | toFileStream(stream, SVGOptions) → to-file-stream.svg |
| to-file.ts | toFile(path, SVGOptions) → to-file.svg |
| to-img-tag.ts | toImgTag() default and custom alt/size → qr-img.html |
All scripts use import QRCode from '@neabyte/qr-generator' (resolved via deno.json when run locally).