-
-
Notifications
You must be signed in to change notification settings - Fork 446
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (21 loc) · 621 Bytes
/
index.js
File metadata and controls
25 lines (21 loc) · 621 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
const escpos = require('..');
const device = new escpos.USB(0x0416, 0x5011);
// const device = new escpos.RawBT();
// const device = new escpos.Network('localhost');
// const device = new escpos.Serial('/dev/usb/lp0');
const printer = new escpos.Printer(device);
device.open(function(err){
printer
.font('a')
.align('ct')
.style('bu')
.size(1, 1)
.text('The quick brown fox jumps over the lazy dog')
.text('敏捷的棕色狐狸跳过懒狗')
.barcode('1234567', 'EAN8')
.qrimage('https://github.com/song940/node-escpos', function(err){
this.cut();
this.close();
});
});