@risleylima/escpos 0.0.12 → 0.0.14
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/package.json
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@risleylima/escpos",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "Library to deal with ESCPOS using some adapters",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Rlima Info",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"private": false,
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=18.0.0"
|
|
11
|
+
},
|
|
9
12
|
"dependencies": {
|
|
10
13
|
"debug": "^4.3.1",
|
|
11
|
-
"get-pixels": "
|
|
14
|
+
"get-pixels": "https://github.com/risleylima/get-pixels",
|
|
12
15
|
"iconv-lite": "^0.6.3",
|
|
13
|
-
"serialport": "^
|
|
16
|
+
"serialport": "^12.0.0",
|
|
14
17
|
"usb": "^1.9.1"
|
|
15
18
|
},
|
|
16
19
|
"directories": {
|
|
17
20
|
"example": "examples"
|
|
18
21
|
},
|
|
19
22
|
"scripts": {
|
|
20
|
-
"test": "echo \"Error: no test specified\"
|
|
23
|
+
"test": "echo \"Error: no test specified\" "
|
|
21
24
|
},
|
|
22
25
|
"repository": {
|
|
23
26
|
"type": "git",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
const SerialPort = require('serialport');
|
|
2
|
+
const { SerialPort } = require('serialport');
|
|
3
3
|
const EventEmitter = require('events');
|
|
4
4
|
const Adapter = require('../adapter');
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ Serial.connect = (port, options) => {
|
|
|
24
24
|
Serial.removeListener('close', connectListener);
|
|
25
25
|
scope.verifyPort(port).catch(e => reject(e)).then((portVerified) => {
|
|
26
26
|
if (portVerified) {
|
|
27
|
-
scope.port = new SerialPort(
|
|
27
|
+
scope.port = new SerialPort(Object.assign(options || {}, { path: portVerified, autoOpen: true }), (err) => {
|
|
28
28
|
if (err) {
|
|
29
29
|
debug('Error Opening the Selected Port: ', err);
|
|
30
30
|
if (scope.port) {
|