Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/denorg/qrcode
📇 Generate QR code images in Deno
https://github.com/denorg/qrcode
deno denoland denorg hacktoberfest hacktoberfest2023 qrcode qrcode-generator typescript
Last synced: 3 days ago
JSON representation
📇 Generate QR code images in Deno
- Host: GitHub
- URL: https://github.com/denorg/qrcode
- Owner: denorg
- License: mit
- Created: 2020-05-15T20:26:10.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-09T10:02:37.000Z (over 1 year ago)
- Last Synced: 2024-04-27T05:35:37.815Z (10 months ago)
- Topics: deno, denoland, denorg, hacktoberfest, hacktoberfest2023, qrcode, qrcode-generator, typescript
- Language: JavaScript
- Homepage: https://denorg.github.io/qrcode/
- Size: 134 KB
- Stars: 43
- Watchers: 9
- Forks: 11
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-deno-cn - @denorg/qrcode
- awesome-deno - qrcode - QR code image generator for Deno. (Modules / Online Playgrounds)
- awesome-deno - qrcode - QR code image generator for Deno. (Modules / Utils)
README
# 📇 QR Code
Generate QR codes in Deno, as base64-encoded images, completely dependency-free and requires no binary.
This is a port of [zenozeng/node-yaqrcode](https://github.com/zenozeng/node-yaqrcode), which itself is a port of the QR code generator in the d-project.
[](https://github.com/denorg/qrcode/actions)
[](https://github.com/denorg/qrcode/blob/master/LICENSE)
[](https://github.com/denorg/qrcode/graphs/contributors)
[](https://denorg.github.io/starter/)
[](https://github.com/denorg)
[](https://github.com/denorg/qrcode)
[](https://github.com/semantic-release/semantic-release)## ⭐ Getting started
```ts
import { qrcode } from "https://deno.land/x/qrcode/mod.ts";
const base64Image = qrcode("bitcoin:ADDRESS?amount=0.5&label=ORDER"); // data:image/gif;base64,...
```
You can also add a custom size by specifying `size` in the second parameter:
```ts
const fixedSizeImage = await qrcode("bitcoin:ADDRESS?amount=0.5&label=ORDER", { size: 500 });
```
### CLI with [DPX](https://github.com/denorg/dpx)After [installing DPX](https://github.com/denorg/dpx), you can directly use the CLI using the `dpx` command:
```bash
dpx qrcode
```### CLI
Alternatively, you can use it directly from the CLI by using `deno run`:
```bash
deno run https://deno.land/x/qrcode/cli.ts
```You can also install it globally using the following:
```bash
deno install https://deno.land/x/qrcode/cli.ts
```Then, the package is available to run:
```bash
qrcode
```## 👩💻 Development
Run tests:
```bash
deno test
```### Notes
- To support typeNumber 40, use the `RS_BLOCK_TABLE` from [davidshimjs/qrcodejs](http://davidshimjs.github.io/qrcodejs/)
- To support UTF-8, use the code from [davidshimjs/qrcodejs](http://davidshimjs.github.io/qrcodejs/)
- Returns a base64-encoded image URL## ⭐ Related Work
- [zenozeng/node-yaqrcode](https://github.com/zenozeng/node-yaqrcode) is the Node.js project that is the origin of this implementation
## 📄 License
- MIT © [Denorg](https://den.org.in)
- Original repo: MIT © [Zeno Zeng](https://github.com/zenozeng/node-yaqrcode)
- "QR Code" is registered trademark of [Denso Wave](http://www.denso-wave.com/qrcode/faqpatent-e.html)
A project by Denorg, the world's first Deno-focused community
organization and consulting company. Work with us →