kjua-revived

0.2.2 • Public • Published

kjua-revived

Kjua Revived is a updated version of the popular kjua QR Code library.

Examples & Usage

Bundler

If you're using a bundler like vite your first step is to install the package:

npm install kjua-revived -D

Next we can consume it from a script with access to browser APIs:

import { kjua } from 'kjua-revived';

const container = document.createElement('div');

const qr = kjua('https://willow.sh');

container.appendChild(qr);
document.body.appendChild(container);

Kjua will return one of the following elements: SVGElement, HTMLCanvasElement, or HTMLImageElement depending on your render method.

Module Script

To use in a regular browser environment you can use a module script:

<script type="module">
	import { kjua } from 'https://cdn.jsdelivr.net/npm/kjua-revived@0/+esm';

	const container = document.createElement('div');

	const qr = kjua('https://willow.sh');

	container.appendChild(qr);
	document.body.appendChild(container);
</script>

Try pasting this into a html file and running it, or checkout this jsfiddle!

Options

TBD

Readme

Keywords

none

Package Sidebar

Install

npm i kjua-revived

Weekly Downloads

73

Version

0.2.2

License

MIT

Unpacked Size

107 kB

Total Files

9

Last publish

Collaborators

  • ghostsos