Skip to content

Commit

Permalink
Merge pull request #3 from slidoapp/qrcode2
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefizso authored Oct 12, 2024
2 parents 62de099 + 29695d7 commit 6b13dca
Show file tree
Hide file tree
Showing 5 changed files with 6,231 additions and 3,498 deletions.
9 changes: 5 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at soldair+qrcode@gmail.com. All
reported by contacting the project team at [oss-conduct@cisco.com][conduct-email]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand All @@ -68,9 +68,10 @@ members of the project's leadership.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>

[homepage]: https://www.contributor-covenant.org
[homepage]: <https://www.contributor-covenant.org>
[conduct-email]: mailto:[email protected]

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
<https://www.contributor-covenant.org/faq>
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# node-qrcode
> QR code/2d barcode generator.
[![Travis](https://img.shields.io/travis/soldair/node-qrcode.svg?style=flat-square)](http://travis-ci.org/soldair/node-qrcode)
[![npm](https://img.shields.io/npm/v/qrcode.svg?style=flat-square)](https://www.npmjs.com/package/qrcode)
[![npm](https://img.shields.io/npm/dt/qrcode.svg?style=flat-square)](https://www.npmjs.com/package/qrcode)
[![npm](https://img.shields.io/npm/l/qrcode.svg?style=flat-square)](https://github.com/soldair/node-qrcode/blob/master/license)
![build status](https://img.shields.io/github/actions/workflow/status/slidoapp/node-qrcode/build.yml?style=flat-square)
[![npm](https://img.shields.io/npm/v/%40slidoapp%2Fqrcode.svg?style=flat-square)](https://www.npmjs.com/package%40slidoapp%2Fqrcode)
[![npm](https://img.shields.io/npm/dt/%40slidoapp%2Fqrcode.svg?style=flat-square)](https://www.npmjs.com/package/%40slidoapp%2Fqrcode)
[![npm](https://img.shields.io/npm/l/%40slidoapp%2Fqrcode.svg?style=flat-square)](https://github.com/slidoapp/node-qrcode/blob/main/license)

- [Highlights](#highlights)
- [Installation](#installation)
Expand Down Expand Up @@ -34,19 +34,19 @@
Inside your project folder do:

```shell
npm install --save qrcode
npm install --save @slidoapp/qrcode
```

or, install it globally to use `qrcode` from the command line to save qrcode images or generate ones you can view in your terminal.

```shell
npm install -g qrcode
npm install -g @slidoapp/qrcode
```

## Usage
### CLI

```
```text
Usage: qrcode [options] <input string>
QR Code options:
Expand Down Expand Up @@ -77,7 +77,7 @@ If not specified, output type is guessed from file extension.<br>
Recognized extensions are `png`, `svg` and `txt`.

### Browser
`node-qrcode` can be used in browser through module bundlers like [Browserify](https://github.com/substack/node-browserify) and [Webpack](https://github.com/webpack/webpack) or by including the precompiled bundle present in `build/` folder.
The `@slidoapp/qrcode` can be used in browser through module bundlers like [Browserify](https://github.com/substack/node-browserify) and [Webpack](https://github.com/webpack/webpack) or by including the precompiled bundle present in `build/` folder.

#### Module bundlers
```html
Expand All @@ -92,7 +92,7 @@ Recognized extensions are `png`, `svg` and `txt`.

```javascript
// index.js -> bundle.js
var QRCode = require('qrcode')
var QRCode = require('@slidoapp/qrcode')
var canvas = document.getElementById('canvas')

QRCode.toCanvas(canvas, 'sample text', function (error) {
Expand All @@ -119,10 +119,10 @@ If you install through `npm`, precompiled files will be available in `node_modul
The precompiled bundle have support for [Internet Explorer 10+, Safari 5.1+, and all evergreen browsers](https://browserl.ist/?q=defaults%2C+IE+%3E%3D+10%2C+Safari+%3E%3D+5.1).

### NodeJS
Require the module `qrcode`
Require the module `@slidoapp/qrcode`

```javascript
var QRCode = require('qrcode')
var QRCode = require('@slidoapp/qrcode')

QRCode.toDataURL('I am a pony!', function (err, url) {
console.log(url)
Expand All @@ -131,7 +131,7 @@ QRCode.toDataURL('I am a pony!', function (err, url) {

render a qrcode for the terminal
```js
var QRCode = require('qrcode')
var QRCode = require('@slidoapp/qrcode')

QRCode.toString('I am a pony!',{type:'terminal'}, function (err, url) {
console.log(url)
Expand All @@ -142,7 +142,7 @@ QRCode.toString('I am a pony!',{type:'terminal'}, function (err, url) {
Promises and Async/Await can be used in place of callback function.

```javascript
import QRCode from 'qrcode'
import QRCode from '@slidoapp/qrcode'

// With promises
QRCode.toDataURL('I am a pony!')
Expand Down Expand Up @@ -262,7 +262,7 @@ In this way no segment optimizations will be applied under the hood.<br>
Segments list can be passed as an array of object:

```javascript
var QRCode = require('qrcode')
var QRCode = require('@slidoapp/qrcode')

var segs = [
{ data: 'ABCDEFG', mode: 'alphanumeric' },
Expand All @@ -286,8 +286,8 @@ An helper method is provided by the lib through an optional file that you can in
**Note:** Support for Kanji mode is only needed if you want to benefit of the data compression, otherwise is still possible to encode kanji using Byte mode (See [Multibyte characters](#multibyte-characters)).

```javascript
var QRCode = require('qrcode')
var toSJIS = require('qrcode/helper/to-sjis')
var QRCode = require('@slidoapp/qrcode')
var toSJIS = require('@slidoapp/qrcode/helper/to-sjis')

QRCode.toDataURL(kanjiString, { toSJISFunc: toSJIS }, function (err, url) {
console.log(url)
Expand Down Expand Up @@ -316,7 +316,7 @@ QR Codes can hold arbitrary byte-based binary data. If you attempt to create a b
```javascript
// Regular array example
// WARNING: Element values will be clamped to 0-255 even if your data contains higher values.
const QRCode = require('qrcode')
const QRCode = require('@slidoapp/qrcode')
QRCode.toFile(
'foo.png',
[{ data: [253,254,255], mode: 'byte' }],
Expand All @@ -327,7 +327,7 @@ QRCode.toFile(

```javascript
// Uint8ClampedArray example
const QRCode = require('qrcode')
const QRCode = require('@slidoapp/qrcode')

QRCode.toFile(
'foo.png',
Expand All @@ -340,7 +340,7 @@ QRCode.toFile(
```javascript
// Node Buffer example
// WARNING: Element values will be clamped to 0-255 even if your data contains higher values.
const QRCode = require('qrcode')
const QRCode = require('@slidoapp/qrcode')

QRCode.toFile(
'foo.png',
Expand Down Expand Up @@ -761,10 +761,13 @@ https://github.com/soldair/node-qrcode/issues/45


## Credits
This lib is based on "QRCode for JavaScript" which Kazuhiko Arase thankfully MIT licensed.

The source code is based on the [QRCode for JavaScript](https://github.com/kazuhikoarase/qrcode-generator) by Kazuhiko Arase,
licenced under [MIT License](https://github.com/kazuhikoarase/qrcode-generator/blob/master/LICENSE).

## License
[MIT](https://github.com/soldair/node-qrcode/blob/master/license)

The word "QR Code" is registered trademark of:<br>
DENSO WAVE INCORPORATED
Source code is licensed under [MIT License](https://github.com/soldair/node-qrcode/blob/master/license).

The word "QR Code" is registered trademark of [DENSO WAVE INCORPORATED](https://www.denso-wave.com)
in Japan and other countries.
1 change: 1 addition & 0 deletions license
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
The MIT License (MIT)

Copyright (c) 2009 Kazuhiko Arase
Copyright (c) 2012 Ryan Day

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Expand Down
Loading

0 comments on commit 6b13dca

Please sign in to comment.