@teamflojo/floimg-qr 0.1.0 → 0.2.0
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 +22 -22
- package/dist/index.d.ts +1 -1
- package/package.json +12 -11
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# floimg-qr
|
|
2
2
|
|
|
3
|
-
QR code generator for
|
|
3
|
+
QR code generator for floimg using the qrcode library.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install @teamflojo/floimg @teamflojo/floimg-qr
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import createClient from '
|
|
15
|
-
import qr from '
|
|
14
|
+
import createClient from '@teamflojo/floimg';
|
|
15
|
+
import qr from '@teamflojo/floimg-qr';
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
17
|
+
const floimg = createClient();
|
|
18
|
+
floimg.registerGenerator(qr());
|
|
19
19
|
|
|
20
20
|
// Generate a QR code
|
|
21
|
-
const qrCode = await
|
|
21
|
+
const qrCode = await floimg.generate({
|
|
22
22
|
generator: 'qr',
|
|
23
23
|
params: {
|
|
24
|
-
text: 'https://github.com/bcooke/
|
|
24
|
+
text: 'https://github.com/bcooke/floimg',
|
|
25
25
|
width: 300,
|
|
26
26
|
errorCorrectionLevel: 'H'
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
|
|
30
30
|
// Save to filesystem or S3
|
|
31
|
-
const result = await
|
|
31
|
+
const result = await floimg.save(qrCode, './output/qr-github.png');
|
|
32
32
|
// Or save to S3:
|
|
33
|
-
// const result = await
|
|
33
|
+
// const result = await floimg.save(qrCode, 's3://my-bucket/qr/github.png');
|
|
34
34
|
console.log(result.location);
|
|
35
35
|
```
|
|
36
36
|
|
|
@@ -39,7 +39,7 @@ console.log(result.location);
|
|
|
39
39
|
### Basic QR Code
|
|
40
40
|
|
|
41
41
|
```typescript
|
|
42
|
-
const qr = await
|
|
42
|
+
const qr = await floimg.generate({
|
|
43
43
|
generator: 'qr',
|
|
44
44
|
params: {
|
|
45
45
|
text: 'Hello World!',
|
|
@@ -51,7 +51,7 @@ const qr = await imgflo.generate({
|
|
|
51
51
|
### URL QR Code
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
|
-
const qr = await
|
|
54
|
+
const qr = await floimg.generate({
|
|
55
55
|
generator: 'qr',
|
|
56
56
|
params: {
|
|
57
57
|
text: 'https://example.com',
|
|
@@ -64,7 +64,7 @@ const qr = await imgflo.generate({
|
|
|
64
64
|
### Custom Colors
|
|
65
65
|
|
|
66
66
|
```typescript
|
|
67
|
-
const qr = await
|
|
67
|
+
const qr = await floimg.generate({
|
|
68
68
|
generator: 'qr',
|
|
69
69
|
params: {
|
|
70
70
|
text: 'Styled QR Code',
|
|
@@ -80,7 +80,7 @@ const qr = await imgflo.generate({
|
|
|
80
80
|
### SVG Output
|
|
81
81
|
|
|
82
82
|
```typescript
|
|
83
|
-
const qr = await
|
|
83
|
+
const qr = await floimg.generate({
|
|
84
84
|
generator: 'qr',
|
|
85
85
|
params: {
|
|
86
86
|
text: 'https://example.com',
|
|
@@ -100,7 +100,7 @@ TEL:+1-555-1234
|
|
|
100
100
|
EMAIL:john@example.com
|
|
101
101
|
END:VCARD`;
|
|
102
102
|
|
|
103
|
-
const qr = await
|
|
103
|
+
const qr = await floimg.generate({
|
|
104
104
|
generator: 'qr',
|
|
105
105
|
params: {
|
|
106
106
|
text: vcard,
|
|
@@ -115,7 +115,7 @@ const qr = await imgflo.generate({
|
|
|
115
115
|
```typescript
|
|
116
116
|
const wifi = 'WIFI:T:WPA;S:MyNetwork;P:MyPassword;;';
|
|
117
117
|
|
|
118
|
-
const qr = await
|
|
118
|
+
const qr = await floimg.generate({
|
|
119
119
|
generator: 'qr',
|
|
120
120
|
params: {
|
|
121
121
|
text: wifi,
|
|
@@ -150,7 +150,7 @@ Higher error correction allows QR codes to be read even if partially damaged, bu
|
|
|
150
150
|
## Configuration
|
|
151
151
|
|
|
152
152
|
```typescript
|
|
153
|
-
|
|
153
|
+
floimg.registerGenerator(qr({
|
|
154
154
|
errorCorrectionLevel: 'H', // Default to high error correction
|
|
155
155
|
width: 400, // Default width
|
|
156
156
|
margin: 5, // Default margin
|
|
@@ -172,7 +172,7 @@ const ticketData = JSON.stringify({
|
|
|
172
172
|
code: 'ABC123'
|
|
173
173
|
});
|
|
174
174
|
|
|
175
|
-
const ticket = await
|
|
175
|
+
const ticket = await floimg.generate({
|
|
176
176
|
generator: 'qr',
|
|
177
177
|
params: {
|
|
178
178
|
text: ticketData,
|
|
@@ -187,7 +187,7 @@ const ticket = await imgflo.generate({
|
|
|
187
187
|
```typescript
|
|
188
188
|
const paymentUrl = 'bitcoin:1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa?amount=0.01';
|
|
189
189
|
|
|
190
|
-
const payment = await
|
|
190
|
+
const payment = await floimg.generate({
|
|
191
191
|
generator: 'qr',
|
|
192
192
|
params: {
|
|
193
193
|
text: paymentUrl,
|
|
@@ -202,7 +202,7 @@ const payment = await imgflo.generate({
|
|
|
202
202
|
```typescript
|
|
203
203
|
const appStore = 'https://apps.apple.com/app/id123456789';
|
|
204
204
|
|
|
205
|
-
const qr = await
|
|
205
|
+
const qr = await floimg.generate({
|
|
206
206
|
generator: 'qr',
|
|
207
207
|
params: {
|
|
208
208
|
text: appStore,
|
|
@@ -236,5 +236,5 @@ MIT
|
|
|
236
236
|
|
|
237
237
|
## See Also
|
|
238
238
|
|
|
239
|
-
- [
|
|
239
|
+
- [floimg](https://github.com/bcooke/floimg) - Core library
|
|
240
240
|
- [qrcode](https://github.com/soldair/node-qrcode) - QR code library
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const qrSchema: GeneratorSchema;
|
|
|
7
7
|
* QR code generator using the qrcode library
|
|
8
8
|
*
|
|
9
9
|
* This generator accepts qrcode library options directly (pass-through pattern).
|
|
10
|
-
* No
|
|
10
|
+
* No floimg abstraction - you get full qrcode library capabilities.
|
|
11
11
|
*
|
|
12
12
|
* @see https://github.com/soldair/node-qrcode - qrcode library documentation
|
|
13
13
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamflojo/floimg-qr",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "QR code generator for floimg using qrcode library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
"README.md",
|
|
17
17
|
"LICENSE"
|
|
18
18
|
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"test": "vitest",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"prepublishOnly": "npm run build"
|
|
26
|
+
},
|
|
19
27
|
"keywords": [
|
|
20
28
|
"floimg",
|
|
21
29
|
"qr",
|
|
@@ -39,18 +47,11 @@
|
|
|
39
47
|
"devDependencies": {
|
|
40
48
|
"@types/node": "^22.10.2",
|
|
41
49
|
"@types/qrcode": "^1.5.5",
|
|
50
|
+
"@teamflojo/floimg": "workspace:*",
|
|
42
51
|
"typescript": "^5.7.2",
|
|
43
|
-
"vitest": "^2.1.8"
|
|
44
|
-
"@teamflojo/floimg": "0.1.0"
|
|
52
|
+
"vitest": "^2.1.8"
|
|
45
53
|
},
|
|
46
54
|
"engines": {
|
|
47
55
|
"node": ">=18.0.0"
|
|
48
|
-
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "tsc",
|
|
51
|
-
"dev": "tsc --watch",
|
|
52
|
-
"test": "vitest",
|
|
53
|
-
"typecheck": "tsc --noEmit",
|
|
54
|
-
"clean": "rm -rf dist"
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Brett Cooke
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|