Skip to content

Commit c088293

Browse files
committed
错误捕获,handler关闭
1 parent c54cda7 commit c088293

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
build/
3+
.vscode
4+
.gitignore
5+
.npmignore
6+
.test.js

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const escpos =require('node-escpos-addon');
77
const usblist = escpos.GetUsbDeviceList();
88
const printer = usblist.find(item => item.service ==='usbprint' || item.deviceName==='USB 打印支持');
99
const content = iconv.encode("你好啊\n halo cpp!\\n\n\n\n\nn\n\n\n\n", 'GB18030');
10-
escpos.PrintRaw(printer.path, content);
10+
const {success, err} = escpos.PrintRaw(printer.path, content);
1111
```
1212

1313

@@ -18,5 +18,5 @@ const escpos =require('node-escpos-addon');
1818
const lptList = escpos.GetLptDeviceList();
1919
const printer = lptList[0];
2020
const content = iconv.encode("你好啊\n halo cpp!\\n\n\n\n\nn\n\n\n\n", 'GB18030');
21-
escpos.PrintRaw(printer.path, content);
21+
const {success, err} = escpos.PrintRaw(printer.path, content);
2222
```

0 commit comments

Comments
 (0)