@tapple.io/qr-code-generator 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -15
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
A lightweight QR code generator with full TypeScript support. Generate QR codes as SVG, PNG, or ASCII with extensive customization options.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/qr-code-generator)
|
|
5
|
+
[](https://www.npmjs.com/package/@tapple.io/qr-code-generator)
|
|
6
6
|
[](LICENSE)
|
|
7
|
-
[](https://www.npmjs.com/package/qr-code-generator)
|
|
8
|
-
[](https://bundlephobia.com/package/qr-code-generator)
|
|
9
7
|
|
|
10
8
|
## Features
|
|
11
9
|
|
|
@@ -20,7 +18,7 @@ A lightweight QR code generator with full TypeScript support. Generate QR codes
|
|
|
20
18
|
## Installation
|
|
21
19
|
|
|
22
20
|
```bash
|
|
23
|
-
npm install qr-code-generator
|
|
21
|
+
npm install @tapple.io/qr-code-generator
|
|
24
22
|
```
|
|
25
23
|
|
|
26
24
|
That's it! The package automatically provides platform-optimized bundles:
|
|
@@ -35,7 +33,7 @@ That's it! The package automatically provides platform-optimized bundles:
|
|
|
35
33
|
The following examples work universally in both Node.js and browsers:
|
|
36
34
|
|
|
37
35
|
```typescript
|
|
38
|
-
import { genQrImage, genQrText } from 'qr-code-generator';
|
|
36
|
+
import { genQrImage, genQrText } from '@tapple.io/qr-code-generator';
|
|
39
37
|
|
|
40
38
|
// Generate PNG buffer (default)
|
|
41
39
|
const pngBuffer = await genQrImage('https://tapple.io');
|
|
@@ -65,7 +63,7 @@ console.log(ascii);
|
|
|
65
63
|
#### Saving to File (Node.js)
|
|
66
64
|
|
|
67
65
|
```typescript
|
|
68
|
-
import { genQrImage } from 'qr-code-generator';
|
|
66
|
+
import { genQrImage } from '@tapple.io/qr-code-generator';
|
|
69
67
|
import fs from 'fs';
|
|
70
68
|
|
|
71
69
|
// Save PNG to file
|
|
@@ -84,7 +82,7 @@ fs.writeFileSync('qrcode.svg', svg);
|
|
|
84
82
|
#### Using in HTML (Browser)
|
|
85
83
|
|
|
86
84
|
```typescript
|
|
87
|
-
import { genQrImage } from 'qr-code-generator';
|
|
85
|
+
import { genQrImage } from '@tapple.io/qr-code-generator';
|
|
88
86
|
|
|
89
87
|
// Display PNG as image (returns dataURL string)
|
|
90
88
|
const img = document.getElementById('qr-image');
|
|
@@ -150,7 +148,7 @@ const ascii = genQrText('Hello', {
|
|
|
150
148
|
### Image Options (PNG & SVG)
|
|
151
149
|
|
|
152
150
|
```typescript
|
|
153
|
-
import { genQrImage, EyeFrameShape, DotShape, BorderShape } from 'qr-code-generator';
|
|
151
|
+
import { genQrImage, EyeFrameShape, DotShape, BorderShape } from '@tapple.io/qr-code-generator';
|
|
154
152
|
|
|
155
153
|
const options = {
|
|
156
154
|
size: 300, // QR matrix size in pixels
|
|
@@ -337,7 +335,7 @@ const qr = await genQrImage('https://tapple.io');
|
|
|
337
335
|
Import shape enums for type-safe customization:
|
|
338
336
|
|
|
339
337
|
```typescript
|
|
340
|
-
import { EyeFrameShape, DotShape, BorderShape, BorderStyle } from 'qr-code-generator';
|
|
338
|
+
import { EyeFrameShape, DotShape, BorderShape, BorderStyle } from '@tapple.io/qr-code-generator';
|
|
341
339
|
|
|
342
340
|
// Eye shapes
|
|
343
341
|
EyeFrameShape.SQUARE
|
|
@@ -364,7 +362,7 @@ BorderStyle.DASHED
|
|
|
364
362
|
### Custom Styled QR Code
|
|
365
363
|
|
|
366
364
|
```typescript
|
|
367
|
-
import { genQrImage, EyeFrameShape, DotShape, BorderShape } from 'qr-code-generator';
|
|
365
|
+
import { genQrImage, EyeFrameShape, DotShape, BorderShape } from '@tapple.io/qr-code-generator';
|
|
368
366
|
|
|
369
367
|
const styledQR = await genQrImage('https://tapple.io', {
|
|
370
368
|
size: 500,
|
|
@@ -395,7 +393,7 @@ const styledQR = await genQrImage('https://tapple.io', {
|
|
|
395
393
|
### QR Code with Logo
|
|
396
394
|
|
|
397
395
|
```typescript
|
|
398
|
-
import { genQrImage } from 'qr-code-generator';
|
|
396
|
+
import { genQrImage } from '@tapple.io/qr-code-generator';
|
|
399
397
|
import fs from 'fs';
|
|
400
398
|
|
|
401
399
|
// Load logo as data URL
|
|
@@ -417,7 +415,7 @@ const qr = await genQrImage('https://tapple.io', {
|
|
|
417
415
|
### Via Module Bundler (Recommended)
|
|
418
416
|
|
|
419
417
|
```typescript
|
|
420
|
-
import { genQrImage } from 'qr-code-generator';
|
|
418
|
+
import { genQrImage } from '@tapple.io/qr-code-generator';
|
|
421
419
|
|
|
422
420
|
const qr = await genQrImage('https://tapple.io', {
|
|
423
421
|
output: { format: 'png', type: 'dataURL' }
|
|
@@ -429,7 +427,7 @@ document.querySelector('#qr-image').src = qr;
|
|
|
429
427
|
|
|
430
428
|
```html
|
|
431
429
|
<script type="module">
|
|
432
|
-
import { genQrImage } from 'https://cdn.jsdelivr.net/npm/qr-code-generator/+esm';
|
|
430
|
+
import { genQrImage } from 'https://cdn.jsdelivr.net/npm/@tapple.io/qr-code-generator/+esm';
|
|
433
431
|
|
|
434
432
|
const qr = await genQrImage('https://tapple.io', {
|
|
435
433
|
output: { format: 'png', type: 'dataURL' }
|
|
@@ -453,7 +451,7 @@ document.querySelector('#qr-image').src = qr;
|
|
|
453
451
|
Full TypeScript support with comprehensive type definitions:
|
|
454
452
|
|
|
455
453
|
```typescript
|
|
456
|
-
import type { ImageOptions, QRInput, VCardData, OutputConfig } from 'qr-code-generator';
|
|
454
|
+
import type { ImageOptions, QRInput, VCardData, OutputConfig } from '@tapple.io/qr-code-generator';
|
|
457
455
|
|
|
458
456
|
const options: ImageOptions = {
|
|
459
457
|
size: 400,
|
|
@@ -561,7 +559,7 @@ Then open [http://localhost:8080/demo/](http://localhost:8080/demo/) in your bro
|
|
|
561
559
|
|
|
562
560
|
**Quick try without cloning:**
|
|
563
561
|
|
|
564
|
-
You can also experiment using online playgrounds like [CodeSandbox](https://codesandbox.io) or [StackBlitz](https://stackblitz.com) by creating a new project and installing
|
|
562
|
+
You can also experiment using online playgrounds like [CodeSandbox](https://codesandbox.io) or [StackBlitz](https://stackblitz.com) by creating a new project and installing `@tapple.io/qr-code-generator`.
|
|
565
563
|
|
|
566
564
|
## License
|
|
567
565
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapple.io/qr-code-generator",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Lightweight QR code generator with ESM and CommonJS support",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"format": "prettier --write src/",
|
|
47
47
|
"format:check": "prettier --check src/",
|
|
48
48
|
"preversion": "npm run format && npm test && npm run lint",
|
|
49
|
-
"version": "npm run build && git add -A dist",
|
|
50
49
|
"postversion": "git push --follow-tags",
|
|
51
50
|
"prepublishOnly": "npm run build"
|
|
52
51
|
},
|