Benefits:
- No dependencies
- Optimal data segmentation
- Labeled grid output
- Built-in permutation logic
- Isomorphic: Works in browser / NodeJS / Bun
Drawbacks:
- No kanji support
- API not final (just getting started)
- Not perf optimized (yet)
bun install qrsart
import { createQR } from 'qrsart'
let qr = createQR('HTTPS://GITHUB.COM/m4r-sh/qrsart',{
minVersion: 2, // 1 - 40
minEcl: 'medium', // 'low','medium','quartile','high'
mask: 0, // 0 - 7
})
console.log(qr)
// QRCode {
// version: 3,
// ecl: "quartile",
// mask: 0,
// data: "HTTPS://GITHUB.COM/m4r-sh/qrsart",
// size: 29,
// bitstring: "001000...110000",
// functional_grid: PixelGrid,
// finder_grid: PixelGrid,
// timing_grid: PixelGrid,
// alignment_positions: PixelGrid,
// alignment_grid: PixelGrid,
// format_grid: PixelGrid,
// version_grid: PixelGrid,
// data_grid: PixelGrid,
// grid: PixelGrid,
// }
To see an image generation example, check out examples
Returns: QRCode
Creates a QRCode object which can be used in custom render logic
Type: String
The raw text to be encoded into the QR Code
Type: Object
-
minVersion
: number (0 - 40) -
maxVersion
: number (0 - 40) -
mask
: number (0 - 8) -
minEcl
: string ('low' | 'medium' | 'quartile' | 'high')
Helper class for 2D matrix of pixels
.setPixel(x,y,v)
.getPixel(x,y)
.usedPixel(x,y)
PixelGrid.combine(...grids)
Helper class for QR Code data
.size
.data
.grid
.data_grid
.functional_grid
.finder_grid
.alignment_grid
.timing_grid
.format_grid
.version_grid
Returns: [String]
Permutes a URL into an array of all possible variations of the same URL.
Type: String
A URL, i.e. https://github.com/m4r-sh
or m4r.sh
Type: Object
Options for URL variation. Caps options permute the substring into every possible uppercase/lowercase combination.
-
protocols
:['http','https']
-
protocol_caps
:true
-
domain_caps
:true
-
path_caps
:false
Returns: [String]
Permutes a WiFi name/pwd into an array of all possible encoding orders.
Type: String
The name of the WiFi network
Type: String
The password of the WiFi network
Example Code | |
Example Code | |
Example Code |
- Nayuki's QR Code Generator
- Russ Cox's Qart Codes
- QRazyBox