@levischuck/receiptline 0.0.4 → 0.1.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 +315 -278
- package/dist/barcode.d.ts +71 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +2336 -0
- package/dist/parse.d.ts +73 -0
- package/dist/targets/audit.d.ts +157 -0
- package/dist/targets/base.d.ts +188 -0
- package/dist/targets/html.d.ts +72 -0
- package/dist/targets/index.d.ts +11 -0
- package/dist/targets/svg.d.ts +52 -0
- package/dist/types.d.ts +68 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -1,278 +1,315 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Markdown for receipts. Printable digital receipts. 🧾
|
|
4
|
-
Generate receipt printer commands and
|
|
5
|
-
|
|
6
|
-
ReceiptLine is the receipt description language that expresses the output image of small roll paper.
|
|
7
|
-
It supports printing paper receipts using a receipt printer and displaying electronic receipts on a POS system or smartphone.
|
|
8
|
-
It can be described simply with receipt markdown text data that does not depend on the paper width.
|
|
9
|
-
|
|
10
|
-
# Installation
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
$ npm install @levischuck/receiptline
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
# Usage
|
|
17
|
-
|
|
18
|
-
`receiptline.transform()` method transforms ReceiptLine document to printer commands or
|
|
19
|
-
|
|
20
|
-
```javascript
|
|
21
|
-
import { transform, SvgTarget } from "@levischuck/receiptline";
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- `
|
|
83
|
-
-
|
|
84
|
-
- `
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
##
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
1
|
+
# ReceiptLine
|
|
2
|
+
|
|
3
|
+
Markdown for receipts. Printable digital receipts. 🧾
|
|
4
|
+
Generate receipt printer commands, SVG images, and HTML documents.
|
|
5
|
+
|
|
6
|
+
ReceiptLine is the receipt description language that expresses the output image of small roll paper.
|
|
7
|
+
It supports printing paper receipts using a receipt printer and displaying electronic receipts on a POS system or smartphone.
|
|
8
|
+
It can be described simply with receipt markdown text data that does not depend on the paper width.
|
|
9
|
+
|
|
10
|
+
# Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
$ npm install @levischuck/receiptline
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
# Usage
|
|
17
|
+
|
|
18
|
+
`receiptline.transform()` method transforms ReceiptLine document to printer commands, SVG images, or HTML documents.
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
import { transform, SvgTarget, HtmlTarget } from "@levischuck/receiptline";
|
|
22
|
+
|
|
23
|
+
const body = `Example Receipt
|
|
24
|
+
(Merchant Copy)
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
{w: * 4 8}
|
|
28
|
+
{b:line}
|
|
29
|
+
||Product | Qty| Price
|
|
30
|
+
|--
|
|
31
|
+
||Pad Thai | 1| 14.99
|
|
32
|
+
||Spring Roll | 1| 4.99
|
|
33
|
+
|--
|
|
34
|
+
{w:* 8}
|
|
35
|
+
|| Subtotal| 19.98
|
|
36
|
+
|| Tax (6%)| 1.20
|
|
37
|
+
|| Convenience Fee| 0.99
|
|
38
|
+
|| Total| 22.17
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
{b:space}
|
|
42
|
+
{w:auto}
|
|
43
|
+
Please Sign:
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
{c:https://levischuck.com;o:qrcode,6}
|
|
50
|
+
|
|
51
|
+
Please Take our Survey`;
|
|
52
|
+
|
|
53
|
+
// SVG Target
|
|
54
|
+
const svgTarget = new SvgTarget();
|
|
55
|
+
svgTarget.setDefaultFont("'Atkinson Hyperlegible Mono'");
|
|
56
|
+
const {content: svg, width, height} = await transform(body, {
|
|
57
|
+
cpl: charactersPerLine,
|
|
58
|
+
charWidth: charWidth,
|
|
59
|
+
target: svgTarget,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// HTML Target
|
|
63
|
+
const htmlTarget = new HtmlTarget();
|
|
64
|
+
htmlTarget.setDefaultFont("'Google Sans Code', monospace");
|
|
65
|
+
htmlTarget.setActualFontCharacterWidth(13.2); // Actual measured width of your font
|
|
66
|
+
htmlTarget.setCharHeight(24); // Character height in pixels
|
|
67
|
+
const {content: html, width: htmlWidth, height: htmlHeight} = await transform(body, {
|
|
68
|
+
cpl: charactersPerLine,
|
|
69
|
+
charWidth: charWidth,
|
|
70
|
+
target: htmlTarget,
|
|
71
|
+
});
|
|
72
|
+
c
|
|
73
|
+
// Do something interesting with the SVG or HTML afterwards
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Method
|
|
77
|
+
|
|
78
|
+
`transform(doc[, options])`
|
|
79
|
+
|
|
80
|
+
### Parameters
|
|
81
|
+
|
|
82
|
+
- `doc`
|
|
83
|
+
- a string of ReceiptLine document
|
|
84
|
+
- `options`
|
|
85
|
+
- an object of printer configuration
|
|
86
|
+
|
|
87
|
+
### Return value
|
|
88
|
+
|
|
89
|
+
- `content`: SVG Image (for SvgTarget) or HTML string (for HtmlTarget)
|
|
90
|
+
- `width`: Width of the generated content in pixels
|
|
91
|
+
- `height`: Height of the generated content in pixels
|
|
92
|
+
|
|
93
|
+
## Printer configuration
|
|
94
|
+
|
|
95
|
+
- `cpl`
|
|
96
|
+
- characters per line (default: `48`)
|
|
97
|
+
- `charWidth`
|
|
98
|
+
- dot width of each character (default: `12`).
|
|
99
|
+
- `spacing`
|
|
100
|
+
- `false`: no line spacing (default)
|
|
101
|
+
- `true`: line spacing
|
|
102
|
+
- `margin` (for printer)
|
|
103
|
+
- print margin (left) (range: `0` - `24`, default: `0`)
|
|
104
|
+
- `marginRight` (for printer)
|
|
105
|
+
- print margin (right) (range: `0` - `24`, default: `0`)
|
|
106
|
+
- `target` What implementation to use (SvgTarget for SVG output, HtmlTarget for HTML output, instantiate your own to set additional configuration like font)
|
|
107
|
+
- `encoding`
|
|
108
|
+
- `multilingual` (default), others exist if you need to look. They mostly adjust line spacing and default fonts.
|
|
109
|
+
|
|
110
|
+
`cpl * charWidth` will be the output width, which by default is 576 dots.
|
|
111
|
+
|
|
112
|
+
## HTML Target Configuration
|
|
113
|
+
|
|
114
|
+
The HTML target provides additional configuration options to account for differences with web fonts and the defaults this library expects for a thermal printer.
|
|
115
|
+
|
|
116
|
+
- `setDefaultFont(font: string)` - Sets the CSS font-family for the receipt (default: "'Courier Prime', monospace")
|
|
117
|
+
- `setActualFontCharacterWidth(width: number | undefined)` - Sets the actual measured character width of your font in pixels. It'll keep the text from going off the side when correctly set.
|
|
118
|
+
- `setCharHeight(height: number | undefined)` - Explicitly sets the character height in pixels. If not set, defaults to `charWidth * 2` (usually 12 * 2)
|
|
119
|
+
|
|
120
|
+
When using the HTML target, you may need to measure your font's actual character width for optimal layout. This is especially important when using web fonts that don't fit the 12 dot wide, 24 dot tall convention.
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
const htmlTarget = new HtmlTarget();
|
|
124
|
+
htmlTarget.setDefaultFont("'Google Sans Code', monospace");
|
|
125
|
+
htmlTarget.setActualFontCharacterWidth(13.2);
|
|
126
|
+
htmlTarget.setCharHeight(24.7);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
# Examples
|
|
130
|
+
### example/data/\*
|
|
131
|
+
|
|
132
|
+
The documents (receipt markdown text) are the same as the examples in the OFSC ReceiptLine Specification.
|
|
133
|
+
|
|
134
|
+
# Grammar
|
|
135
|
+
|
|
136
|
+
## Structure
|
|
137
|
+
|
|
138
|
+
The receipt is made of a table, which separates each column with a pipe `|`.
|
|
139
|
+
|
|
140
|
+
|Line|Content|Description|
|
|
141
|
+
|---|---|---|
|
|
142
|
+
|_column_<br><code>|</code> _column_ <code>|</code><br><code>|</code> _column_<br>_column_ <code>|</code>|Text<br>Property|Single column|
|
|
143
|
+
|_column_ <code>|</code> _column_ <br><code>|</code> _column_ <code>|</code> _column_ <code>|</code><br><code>|</code> _column_ <code>|</code> _column_<br>_column_ <code>|</code> _column_ <code>|</code>|Text|Double column|
|
|
144
|
+
|_column_ <code>|</code> _..._ <code>|</code> _column_<br><code>|</code> _column_ <code>|</code> _..._ <code>|</code> _column_ <code>|</code><br><code>|</code> _column_ <code>|</code> _..._ <code>|</code> _column_<br>_column_ <code>|</code> _..._ <code>|</code> _column_ <code>|</code>|Text|Multiple columns|
|
|
145
|
+
|
|
146
|
+
## Alignment
|
|
147
|
+
|
|
148
|
+
The column is attracted to the pipe `|` like a magnet.
|
|
149
|
+
<code>␣</code> means one or more whitespaces.
|
|
150
|
+
|
|
151
|
+
|Column|Description|
|
|
152
|
+
|---|---|
|
|
153
|
+
|_column_<br><code>|</code>_column_<code>|</code><br><code>|␣</code>_column_<code>␣|</code>|Center|
|
|
154
|
+
|<code>|</code>_column_<br><code>|</code>_column_<code>␣|</code><br>_column_<code>␣|</code>|Left|
|
|
155
|
+
|_column_<code>|</code><br><code>|␣</code>_column_<code>|</code><br><code>|␣</code>_column_|Right|
|
|
156
|
+
|
|
157
|
+
## Text
|
|
158
|
+
|
|
159
|
+
The text is valid for any column.
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Asparagus | 0.99
|
|
163
|
+
Broccoli | 1.99
|
|
164
|
+
Carrot | 2.99
|
|
165
|
+
---
|
|
166
|
+
^TOTAL | ^5.97
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Characters are printed in a monospace font (12 x 24 px).
|
|
170
|
+
Wide characters are twice as wide as Latin characters (24 x 24 px).
|
|
171
|
+
Control characters are ignored.
|
|
172
|
+
|
|
173
|
+
## Special characters in text
|
|
174
|
+
|
|
175
|
+
Special characters are assigned to characters that are rarely used in the receipt.
|
|
176
|
+
|
|
177
|
+
|Special character|Description|
|
|
178
|
+
|---|---|
|
|
179
|
+
|`\`|Character escape|
|
|
180
|
+
|<code>|</code>|Column delimiter|
|
|
181
|
+
|`{`|Property delimiter (Start)|
|
|
182
|
+
|`}`|Property delimiter (End)|
|
|
183
|
+
|`-` (1 or more, exclusive)|Horizontal rule|
|
|
184
|
+
|`=` (1 or more, exclusive)|Paper cut|
|
|
185
|
+
|`~`|Space|
|
|
186
|
+
|`_`|Underline|
|
|
187
|
+
|`"`|Emphasis|
|
|
188
|
+
|`` ` ``|Invert|
|
|
189
|
+
|`^`|Double width|
|
|
190
|
+
|`^^`|Double height|
|
|
191
|
+
|`^^^`|2x size|
|
|
192
|
+
|`^^^^`|3x size|
|
|
193
|
+
|`^^^^^`|4x size|
|
|
194
|
+
|`^^^^^^`|5x size|
|
|
195
|
+
|`^^^^^^^` (7 or more)|6x size|
|
|
196
|
+
|
|
197
|
+
## Escape sequences in text
|
|
198
|
+
|
|
199
|
+
Escape special characters.
|
|
200
|
+
|
|
201
|
+
|Escape sequence|Description|
|
|
202
|
+
|---|---|
|
|
203
|
+
|`\\`|\|
|
|
204
|
+
|<code>\|</code>|||
|
|
205
|
+
|`\{`|{|
|
|
206
|
+
|`\}`|}|
|
|
207
|
+
|`\-`|- (Cancel horizontal rule)|
|
|
208
|
+
|`\=`|= (Cancel paper cut)|
|
|
209
|
+
|`\~`|~|
|
|
210
|
+
|`\_`|_|
|
|
211
|
+
|`\"`|_|
|
|
212
|
+
|``\` ``|`|
|
|
213
|
+
|`\^`|^|
|
|
214
|
+
|`\n`|Wrap text manually|
|
|
215
|
+
|`\x`_nn_|Hexadecimal character code|
|
|
216
|
+
|`\`_char_ (Others)|Ignore|
|
|
217
|
+
|
|
218
|
+
## Properties
|
|
219
|
+
|
|
220
|
+
The property is valid for lines with a single column.
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
{ width: * 10; comment: the column width is specified in characters }
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
|Key|Abbreviation|Value|Case-sensitive|Default|Saved|Description|
|
|
227
|
+
|---|---|---|---|---|---|---|
|
|
228
|
+
|`image`|`i`|_base64 png format_|✓|-|-|Image<br>(Recommended: monochrome, critical chunks only)|
|
|
229
|
+
|`code`|`c`|_textdata_|✓|-|-|Barcode / 2D code|
|
|
230
|
+
|`option`|`o`|_see below_|-|`code128 2 72 nohri 3 l`|✓|Barcode / 2D code options<br>(Options are separated by commas or one or more whitespaces)|
|
|
231
|
+
|`align`|`a`|`left`<br>`center`<br>`right`|-|`center`|✓|Line alignment<br>(Valid when line width < CPL)|
|
|
232
|
+
|`width`|`w`|`auto`<br>`*`<br>`0` -|-|`auto`<br>(`*` for all columns)|✓|Column widths (chars)<br>(Widths are separated by commas or one or more whitespaces)|
|
|
233
|
+
|`border`|`b`|`line`<br>`space`<br>`none`<br>`0` - `2`|-|`space`|✓|Column border (chars)<br>(Border width: line=1, space=1, none=0)|
|
|
234
|
+
|`text`|`t`|`wrap`<br>`nowrap`|-|`wrap`|✓|Text wrapping|
|
|
235
|
+
|`command`|`x`|_textdata_|✓|-|-|Device-specific commands|
|
|
236
|
+
|`comment`|`_`|_textdata_|✓|-|-|Comment|
|
|
237
|
+
|
|
238
|
+
## Barcode options
|
|
239
|
+
|
|
240
|
+
Barcode options are separated by commas or one or more whitespaces.
|
|
241
|
+
|
|
242
|
+
|Barcode option|Description|
|
|
243
|
+
|---|---|
|
|
244
|
+
|`upc`|UPC-A, UPC-E<br>(Check digit can be omitted)|
|
|
245
|
+
|`ean`<br>`jan`|EAN-13, EAN-8<br>(Check digit can be omitted)|
|
|
246
|
+
|`code39`|CODE39|
|
|
247
|
+
|`itf`|Interleaved 2 of 5|
|
|
248
|
+
|`codabar`<br>`nw7`|Codabar (NW-7)|
|
|
249
|
+
|`code93`|CODE93|
|
|
250
|
+
|`code128`|CODE128|
|
|
251
|
+
|`2` - `4`|Barcode module width (px)|
|
|
252
|
+
|`24` - `240`|Barcode module height (px)|
|
|
253
|
+
|`hri`|With human readable interpretation|
|
|
254
|
+
|`nohri`|Without human readable interpretation|
|
|
255
|
+
|
|
256
|
+
## 2D code options
|
|
257
|
+
|
|
258
|
+
2D code options are separated by commas or one or more whitespaces.
|
|
259
|
+
|
|
260
|
+
|2D code option|Description|
|
|
261
|
+
|---|---|
|
|
262
|
+
|`qrcode`|QR Code|
|
|
263
|
+
|`3` - `8`|Cell size (px)|
|
|
264
|
+
|`l`<br>`m`<br>`q`<br>`h`|Error correction level|
|
|
265
|
+
|
|
266
|
+
## Special characters in property values
|
|
267
|
+
|
|
268
|
+
Special characters in property values are different from special characters in text.
|
|
269
|
+
|
|
270
|
+
|Special character|Description|
|
|
271
|
+
|---|---|
|
|
272
|
+
|`\`|Character escape|
|
|
273
|
+
|<code>|</code>|Column delimiter|
|
|
274
|
+
|`{`|Property delimiter (Start)|
|
|
275
|
+
|`}`|Property delimiter (End)|
|
|
276
|
+
|`:`|Key-value separator|
|
|
277
|
+
|`;`|Key-value delimiter|
|
|
278
|
+
|
|
279
|
+
## Escape sequences in property values
|
|
280
|
+
|
|
281
|
+
Escape special characters.
|
|
282
|
+
|
|
283
|
+
|Escape sequence|Description|
|
|
284
|
+
|---|---|
|
|
285
|
+
|`\\`|\|
|
|
286
|
+
|<code>\|</code>|||
|
|
287
|
+
|`\{`|{|
|
|
288
|
+
|`\}`|}|
|
|
289
|
+
|`\;`|;|
|
|
290
|
+
|`\n`|New line|
|
|
291
|
+
|`\x`_nn_|Hexadecimal character code|
|
|
292
|
+
|`\`_char_ (Others)|Ignore|
|
|
293
|
+
|
|
294
|
+
# Why use this one over the reference implementation?
|
|
295
|
+
|
|
296
|
+
The original library has a weird hack to generate UUIDs on insecure contexts to get around a [currently debated WebCrypto standards detail](https://github.com/w3c/webcrypto/issues/408).
|
|
297
|
+
This prevented me from deploying to Cloudflare workers.
|
|
298
|
+
This fork and typescript adjustment is enough to unblock my objective.
|
|
299
|
+
|
|
300
|
+
I also wanted to use a diferent font.
|
|
301
|
+
|
|
302
|
+
# License
|
|
303
|
+
|
|
304
|
+
Apache 2 Licensed, per the [original source](https://github.com/receiptline/receiptline)
|
|
305
|
+
|
|
306
|
+
The word "QR Code" is registered trademark of DENSO WAVE INCORPORATED
|
|
307
|
+
http://www.denso-wave.com/qrcode/faqpatent-e.html
|
|
308
|
+
|
|
309
|
+
# Author
|
|
310
|
+
|
|
311
|
+
Open Foodservice System Consortium
|
|
312
|
+
http://www.ofsc.or.jp/
|
|
313
|
+
|
|
314
|
+
Levi Schuck
|
|
315
|
+
https://levischuck.com/
|