• Stars
    star
    382
  • Rank 111,597 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Generate characteristic qrcodes with a canvas.

QRCanvas

NPM License Downloads

This is a QRCode generator written in pure javascript.

Based on Kazuhiko Arase's QRCode.

The only requirement is that the browser works with a canvas, which is supported by most modern browsers.

Usage

With bundlers

Install as a dependency:

$ yarn add qrcanvas
# or
$ npm install qrcanvas -S

Use as a module:

import { qrcanvas } from 'qrcanvas';

const canvas = qrcanvas({
  data: 'hello, world'
});
document.body.appendChild(canvas);

Browser

Load from CDN:

<div id="qrcode"></div>

<script src="https://cdn.jsdelivr.net/npm/qrcanvas@3"></script>

The module is mounted to a global variable named qrcanvas:

const canvas = qrcanvas.qrcanvas({
  data: 'hello, world'
});
document.getElementById('qrcode').appendChild(canvas);

Node.js

node-canvas is required in Node.js.

Install dependencies:

$ yarn add qrcanvas canvas
const fs = require('fs');
const { qrcanvas, setCanvasModule } = require('qrcanvas');

// Enable node-canvas
setCanvasModule(require('canvas'));

const canvas = qrcanvas({
  data: 'hello, world'
});
// canvas is an instance of `node-canvas`
canvas.pngStream().pipe(fs.createWriteStream('qrcode.png'));

Documents

Related

Snapshots

1

2

More Repositories

1

qqlib

[DEPRECATED] QQ login library based on webqq
Python
162
star
2

jsqrgen

DEPRECATED in favor of qrcanvas.
JavaScript
94
star
3

qrcanvas-vue

A QRCode component for use with Vue.js
JavaScript
73
star
4

async_dns

DNS library based on asyncio
Python
66
star
5

request-x

A web extension to block or modify requests.
TypeScript
36
star
6

h5player

HTML5 music player
JavaScript
30
star
7

json-formatter

A userscript to display JSON data beautifully.
JavaScript
30
star
8

ai.nvim

A Neovim plugin powered by Google Gemini.
Lua
27
star
9

json-server.py

Fake REST API with zero coding
Python
20
star
10

coc-format-json

Format JSON strings on the fly
TypeScript
12
star
11

tw-prism

TiddlyWiki plugin to provide syntax highlight with PrismJS
JavaScript
10
star
12

jsx-dom

Use JSX for HTML elements.
TypeScript
8
star
13

pysocks

A SOCKS server and client package built with asyncio.
Python
8
star
14

srun3k

SRun3K Stupid
C#
7
star
15

vue-code

DEPRECATED in favor of vueleton
JavaScript
7
star
16

restful-fetch

Restful APIs based on isomorphic-fetch
JavaScript
6
star
17

Stylish-oex

Stylish for Opera
JavaScript
5
star
18

react-deep-diff

React component to show diff between two objects
TypeScript
5
star
19

generator-h5

Create an HTML5 workspace rapidly using yeoman
JavaScript
4
star
20

tarjs

TypeScript
4
star
21

marktiddly

Render Markdown files as tiddlers
TypeScript
4
star
22

vueleton

Vue components with only core features.
Vue
4
star
23

dotfiles

Gerald's vimfiles
Lua
3
star
24

garfield

Web server to execute commands.
JavaScript
3
star
25

git-ass

A custom command for git to support branch alias and association.
Python
3
star
26

ensure-dir

Ensure a directory exists, if not, make it.
JavaScript
3
star
27

jar-parser

A simple parser to parse jar files
JavaScript
3
star
28

async-doh

DNS over HTTPS based on aiohttp and async-dns
Python
3
star
29

npm2url

Convert an NPM package import into a CDN URL.
TypeScript
3
star
30

ipfs-editor-vscode

IPFS editor as a VSCode extension
TypeScript
3
star
31

deno-lib

Handy utilities for deno
TypeScript
2
star
32

js-scanner

Scan dependencies among packages
TypeScript
2
star
33

pysrun3k

SRun3K Stupid written in pure Python
Python
2
star
34

restful-ng

RESTful service for Angular 1.x
JavaScript
2
star
35

duoshuo-ua

ๅคš่ฏด่ฏ„่ฎบๆ’ไปถ๏ผŒๆ˜พ็คบ็•™่จ€็”จๆˆทไฝฟ็”จ็š„ๆ“ไฝœ็ณป็ปŸๅ’Œๆต่งˆๅ™จใ€‚
JavaScript
2
star
36

github-widget-lite

A lite Github widget loader without dependencies
JavaScript
2
star
37

pyweb

A simple HTTP server written in Python 3.5+, requiring asyncio.
Python
2
star
38

cnt

HTML
2
star
39

qrcanvas-react

A QRCode component for use with ReactJS
JavaScript
2
star
40

generator-vue-ssr

Generate a project built with Vue.js with server-side rendering.
JavaScript
2
star
41

nebula-easy

A web-based dashboard for nebula
Go
2
star
42

plaid

Webpack utility helpers
JavaScript
1
star
43

phpfetching

Web fetcher written in PHP, supporting cookie files.
PHP
1
star
44

clean-run

Run a Node.js script in a clean environment
JavaScript
1
star
45

sync-promise-lite

DEPRECATED in favor of promise-lite.
JavaScript
1
star
46

koa-proxypass

A proxy-pass server for koa
JavaScript
1
star
47

node-mocker

DEPRECATED
JavaScript
1
star
48

pyserve

Serve asyncio and aiohttp servers
Python
1
star
49

barcode-core

Generate barcode data
JavaScript
1
star
50

letsvote

Let's vote!
JavaScript
1
star
51

spa-static

A web server for SPAs.
JavaScript
1
star
52

stylish-mx

Stylish facilitates modification of the way websites look on Maxthon.
JavaScript
1
star
53

gera2ld

1
star
54

webfs-explorer

TypeScript
1
star
55

nebula-web

UI of NebulaEasy
Svelte
1
star
56

chromium-versions

Download any version of Chromium from the official snapshots
HTML
1
star
57

img-cropper

A lite image cropper based on canvas
JavaScript
1
star
58

deepdiff

Deep difference JSON objects
TypeScript
1
star
59

locky

Transform lock files for different registries.
JavaScript
1
star
60

define-commonjs

Yet another CommonJS implementation
JavaScript
1
star
61

rclone-webdav

A WebDAV server powered by rclone
Go
1
star