@tapple.io/qr-code-generator 0.9.1 → 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 +12 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ A lightweight QR code generator with full TypeScript support. Generate QR codes
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npm install qr-code-generator
|
|
21
|
+
npm install @tapple.io/qr-code-generator
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
That's it! The package automatically provides platform-optimized bundles:
|
|
@@ -33,7 +33,7 @@ That's it! The package automatically provides platform-optimized bundles:
|
|
|
33
33
|
The following examples work universally in both Node.js and browsers:
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import { genQrImage, genQrText } from 'qr-code-generator';
|
|
36
|
+
import { genQrImage, genQrText } from '@tapple.io/qr-code-generator';
|
|
37
37
|
|
|
38
38
|
// Generate PNG buffer (default)
|
|
39
39
|
const pngBuffer = await genQrImage('https://tapple.io');
|
|
@@ -63,7 +63,7 @@ console.log(ascii);
|
|
|
63
63
|
#### Saving to File (Node.js)
|
|
64
64
|
|
|
65
65
|
```typescript
|
|
66
|
-
import { genQrImage } from 'qr-code-generator';
|
|
66
|
+
import { genQrImage } from '@tapple.io/qr-code-generator';
|
|
67
67
|
import fs from 'fs';
|
|
68
68
|
|
|
69
69
|
// Save PNG to file
|
|
@@ -82,7 +82,7 @@ fs.writeFileSync('qrcode.svg', svg);
|
|
|
82
82
|
#### Using in HTML (Browser)
|
|
83
83
|
|
|
84
84
|
```typescript
|
|
85
|
-
import { genQrImage } from 'qr-code-generator';
|
|
85
|
+
import { genQrImage } from '@tapple.io/qr-code-generator';
|
|
86
86
|
|
|
87
87
|
// Display PNG as image (returns dataURL string)
|
|
88
88
|
const img = document.getElementById('qr-image');
|
|
@@ -148,7 +148,7 @@ const ascii = genQrText('Hello', {
|
|
|
148
148
|
### Image Options (PNG & SVG)
|
|
149
149
|
|
|
150
150
|
```typescript
|
|
151
|
-
import { genQrImage, EyeFrameShape, DotShape, BorderShape } from 'qr-code-generator';
|
|
151
|
+
import { genQrImage, EyeFrameShape, DotShape, BorderShape } from '@tapple.io/qr-code-generator';
|
|
152
152
|
|
|
153
153
|
const options = {
|
|
154
154
|
size: 300, // QR matrix size in pixels
|
|
@@ -335,7 +335,7 @@ const qr = await genQrImage('https://tapple.io');
|
|
|
335
335
|
Import shape enums for type-safe customization:
|
|
336
336
|
|
|
337
337
|
```typescript
|
|
338
|
-
import { EyeFrameShape, DotShape, BorderShape, BorderStyle } from 'qr-code-generator';
|
|
338
|
+
import { EyeFrameShape, DotShape, BorderShape, BorderStyle } from '@tapple.io/qr-code-generator';
|
|
339
339
|
|
|
340
340
|
// Eye shapes
|
|
341
341
|
EyeFrameShape.SQUARE
|
|
@@ -362,7 +362,7 @@ BorderStyle.DASHED
|
|
|
362
362
|
### Custom Styled QR Code
|
|
363
363
|
|
|
364
364
|
```typescript
|
|
365
|
-
import { genQrImage, EyeFrameShape, DotShape, BorderShape } from 'qr-code-generator';
|
|
365
|
+
import { genQrImage, EyeFrameShape, DotShape, BorderShape } from '@tapple.io/qr-code-generator';
|
|
366
366
|
|
|
367
367
|
const styledQR = await genQrImage('https://tapple.io', {
|
|
368
368
|
size: 500,
|
|
@@ -393,7 +393,7 @@ const styledQR = await genQrImage('https://tapple.io', {
|
|
|
393
393
|
### QR Code with Logo
|
|
394
394
|
|
|
395
395
|
```typescript
|
|
396
|
-
import { genQrImage } from 'qr-code-generator';
|
|
396
|
+
import { genQrImage } from '@tapple.io/qr-code-generator';
|
|
397
397
|
import fs from 'fs';
|
|
398
398
|
|
|
399
399
|
// Load logo as data URL
|
|
@@ -415,7 +415,7 @@ const qr = await genQrImage('https://tapple.io', {
|
|
|
415
415
|
### Via Module Bundler (Recommended)
|
|
416
416
|
|
|
417
417
|
```typescript
|
|
418
|
-
import { genQrImage } from 'qr-code-generator';
|
|
418
|
+
import { genQrImage } from '@tapple.io/qr-code-generator';
|
|
419
419
|
|
|
420
420
|
const qr = await genQrImage('https://tapple.io', {
|
|
421
421
|
output: { format: 'png', type: 'dataURL' }
|
|
@@ -427,7 +427,7 @@ document.querySelector('#qr-image').src = qr;
|
|
|
427
427
|
|
|
428
428
|
```html
|
|
429
429
|
<script type="module">
|
|
430
|
-
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';
|
|
431
431
|
|
|
432
432
|
const qr = await genQrImage('https://tapple.io', {
|
|
433
433
|
output: { format: 'png', type: 'dataURL' }
|
|
@@ -451,7 +451,7 @@ document.querySelector('#qr-image').src = qr;
|
|
|
451
451
|
Full TypeScript support with comprehensive type definitions:
|
|
452
452
|
|
|
453
453
|
```typescript
|
|
454
|
-
import type { ImageOptions, QRInput, VCardData, OutputConfig } from 'qr-code-generator';
|
|
454
|
+
import type { ImageOptions, QRInput, VCardData, OutputConfig } from '@tapple.io/qr-code-generator';
|
|
455
455
|
|
|
456
456
|
const options: ImageOptions = {
|
|
457
457
|
size: 400,
|
|
@@ -559,7 +559,7 @@ Then open [http://localhost:8080/demo/](http://localhost:8080/demo/) in your bro
|
|
|
559
559
|
|
|
560
560
|
**Quick try without cloning:**
|
|
561
561
|
|
|
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
|
|
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`.
|
|
563
563
|
|
|
564
564
|
## License
|
|
565
565
|
|