Skip to content

Commit a66ffa3

Browse files
authored
modify readme file add cut notes for #50
1 parent c1ef8c6 commit a66ffa3

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

README.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ESC/POS Printer driver for node
77
## Installation
88

99
````
10-
$ npm i escpos
10+
$ npm i escpos --save
1111
````
1212

1313
if you use usb as an adapter :
@@ -46,36 +46,24 @@ device.open(function(){
4646
});
4747

4848
});
49-
50-
5149
````
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.
5650

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+
----
5852

59-
Triggers the callback function when done.
6053

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
6355

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)
6657

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.
6859

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 .
7161

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.
7363

7464
### close(function callback)
75-
Closes the current device and releases its USB interface.
7665

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.
7967

8068
----
8169

@@ -158,6 +146,8 @@ Cut paper.
158146
mode set a full or partial cut. Default: full
159147
Partial cut is not implemented in all printers.
160148

149+
*** Don't foget this, because cut will flush buffer to printer ***
150+
161151
### cashdraw(pin)
162152

163153
Sends a pulse to the cash drawer in the specified pin.

0 commit comments

Comments
 (0)