const usbDevice = new escpos.USB();
const usbScreen = new escpos.Screen(usbDevice);
const serialDevice = new escpos.Serial('/dev/ttyUSB0');
const serialScreen = new escpos.Screen(serialDevice);
const bluetoothDevice = new escpos.Bluetooth('01:23:45:67:89:AB', 1);
const bluetoothScreen = new escpos.Screen(bluetoothDevice);
const networkDevice = new escpos.Network('localhost');
const networkScreen = new escpos.Screen(networkDevice);
Clears all displayed characters.
Clears the line containing the cursor.
Moves the cursor up one line.
Moves the cursor one character position to the left.
Moves the cursor one character position to the right.
Moves the cursor down one line.
Moves the cursor to the left-most position on the upper line (home position).
Moves the cursor to the right-most position on the current line.
Moves the cursor to the left-most position on the current line.
Moves the cursor to the bottom position.
Moves the cursor to the nth position on the mth line.
Selects overwrite mode as the screen display mode.
Selects vertical scroll mode as the screen display mode.
Selects horizontal scroll mode as the display screen mode.
Turn cursor display mode on/off.
"display" Refers to the on/off boolean state.
Sets display screen blank interval. "step" Refers to the blink interval. The interval [ON= step × 50 ms] / [OFF = step × 50 ms] is repeated.
Sets the counter time and displays it in the bottom right of the screen. "h" Refers to hours: 0≤ h ≤ 23 "m" Refers to minutes: 0≤ m ≤ 59
Displays the time counter at the right side of the bottom line.
Sets the brightness of the fluorescent character display tube. "level" Refers to brightness level: 1 ≤ level ≤ 4
Selects or cancels reverse display of the characters received after this command. "n" Refers selects/cancels reverse boolean state.
Prints raw text. Raises TextError exception.
For the encode type, see the iconv-lite wiki document. Escpos uses iconv-lite
for encoding.
If the type is undefined, the default type is GB18030.
Sets the encoding value globally. default type is GB18030 (Chinese)
Flush buffer and closes the current device.