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
+10-20Lines changed: 10 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ESC/POS Printer driver for node
7
7
## Installation
8
8
9
9
````
10
-
$ npm i escpos
10
+
$ npm i escpos --save
11
11
````
12
12
13
13
if you use usb as an adapter :
@@ -46,36 +46,24 @@ device.open(function(){
46
46
});
47
47
48
48
});
49
-
50
-
51
49
````
52
-
----
53
-
## USB Adapter methods
54
-
### open(function calback)
55
-
Claims the current device USB, if the printer is already in use by other process this will fail.
56
50
57
-
By default, the USB adapter will set the first printer found, if you have multiple printers use `setDevice` and `getDevices` to switch between printers.
51
+
----
58
52
59
-
Triggers the callback function when done.
60
53
61
-
### openAll()
62
-
Claims all the printers connected to the machine, one by one. When done, sets the first printer found as the default device and triggers the callback function.
54
+
## USB Adapter methods
63
55
64
-
### getDevices()
65
-
Returns the number (N) of printers connected, if open is called you must open each device in order to use it.
56
+
### open(function calback)
66
57
67
-
The ID of the printer will be the number you want to set from 0 to N-1.
58
+
Claims the current device USB, if the printer is already in use by other process this will fail.
68
59
69
-
### setDevice(N)
70
-
Sets the index passed as the current device, N must be higher than 0 and lower than `getDevices()`.
60
+
By default, the USB adapter will set the first printer found .
71
61
72
-
This must be called before printing if you want to swtich between multiple printers connected to the same device.
62
+
Triggers the callback function when done.
73
63
74
64
### close(function callback)
75
-
Closes the current device and releases its USB interface.
76
65
77
-
### closeAll(function callback)
78
-
Similar to `close()` but loops through all the devices connected and closes them all.
66
+
Closes the current device and releases its USB interface.
79
67
80
68
----
81
69
@@ -158,6 +146,8 @@ Cut paper.
158
146
mode set a full or partial cut. Default: full
159
147
Partial cut is not implemented in all printers.
160
148
149
+
*** Don't foget this, because cut will flush buffer to printer ***
150
+
161
151
### cashdraw(pin)
162
152
163
153
Sends a pulse to the cash drawer in the specified pin.
0 commit comments