https://github.com/ghostdevv/kjua-revived
https://github.com/ghostdevv/kjua-revived
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ghostdevv/kjua-revived
- Owner: ghostdevv
- License: mit
- Created: 2024-02-13T20:38:28.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-19T21:09:50.000Z (over 1 year ago)
- Last Synced: 2025-09-19T17:44:42.609Z (6 months ago)
- Language: TypeScript
- Size: 514 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kjua-revived
Kjua Revived is a updated version of the popular [kjua](https://github.com/lrsjng/kjua) QR Code library.
# Examples & Usage
## Bundler
If you're using a bundler like vite your first step is to install the package:
```bash
npm install kjua-revived -D
```
Next we can consume it from a script with access to browser APIs:
```ts
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:
```html
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);
```
Try pasting this into a html file and running it, or checkout this [jsfiddle](https://jsfiddle.net/7ohenpqb/)!
# Options
TBD