You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-8Lines changed: 23 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
<br/>
8
8
<br/>
9
9
10
-
> It is a fork of [node-escpos](https://github.com/song940/node-escpos) with some improvements. Thanks to the original [author](https://github.com/song940). And I'll bring more improvements in the future.
10
+
> It is a fork of [node-escpos](https://github.com/node-escpos/driver) with some improvements. Thanks to the original [author](https://github.com/song940). And I'll bring more improvements in the future.
11
11
12
12
### Improvements
13
13
- 🛠 It is rewritten in TypeScript.
@@ -42,15 +42,26 @@ const device = new USB();
42
42
constoptions= { encoding:"GB18030"/* default */ }
43
43
constprinter=newPrinter(device, options);
44
44
45
-
device.open(function(error){
45
+
device.open(asyncfunction(err){
46
+
if(err){
47
+
// handle error
48
+
return
49
+
}
50
+
51
+
let printer =newPrinter(device, {});
52
+
53
+
// Path to png image
54
+
consttux=join();
55
+
constimage=awaitImage.load(tux);
56
+
46
57
printer
47
58
.font("a")
48
59
.align("ct")
49
60
.style("bu")
50
61
.size(1, 1)
51
62
.text("The quick brown fox jumps over the lazy dog")
0 commit comments