Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Rich-Harris/headless-qr
A simple, modern QR code library
https://github.com/Rich-Harris/headless-qr
Last synced: 12 days ago
JSON representation
A simple, modern QR code library
- Host: GitHub
- URL: https://github.com/Rich-Harris/headless-qr
- Owner: Rich-Harris
- Created: 2023-04-18T01:23:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-18T16:55:29.000Z (over 1 year ago)
- Last Synced: 2024-04-14T06:11:58.143Z (7 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 409
- Watchers: 8
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# headless-qr
A simple, modern QR code generator. Adapted from https://github.com/kazuhikoarase/qrcode-generator but without all the junk that was necessary 10 years ago.
## Usage
```js
import { qr } from 'headless-qr';// generate an n x n array of booleans,
// where `true` is a dark pixel
const modules = qr('https://example.com');// specify version and error correction
const modules = qr('https://example.com', {
version: 40, // 1 - 40, will select the best version if unspecified
correction: 'Q' // L, M, Q or H
});
```