Skip to content

Commit ad1cade

Browse files
committed
v3.0.0-alpha.1
1 parent b490264 commit ad1cade

35 files changed

+759
-515
lines changed

README.md

+12-369
Large diffs are not rendered by default.

examples/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
const escpos = require('../');
2+
const escpos = require('..');
33

44
const device = new escpos.USB(0x0416, 0x5011);
55
// const device = new escpos.RawBT();

index.js

-21
This file was deleted.

lerna.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"version": "3.0.0-alpha.1"
6+
}

package.json

+3-50
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,7 @@
11
{
2-
"name": "escpos",
3-
"version": "2.5.2",
4-
"description": "ESC/POS Printer driver for nodejs",
5-
"main": "index.js",
6-
"scripts": {
7-
"test": "mocha",
8-
"start": "node server.js"
9-
},
10-
"repository": {
11-
"type": "git",
12-
"url": "git+https://github.com/song940/node-escpos.git"
13-
},
14-
"keywords": [
15-
"escpos",
16-
"printer"
17-
],
18-
"author": "Lsong <[email protected]> (https://lsong.org)",
19-
"contributors": [
20-
"Jose Vera <[email protected]>",
21-
"Sébastien Vidal <[email protected]>",
22-
"Yu Yongwoo <[email protected]>",
23-
"Attawit Kittikrairit <[email protected]>",
24-
"Risley Lima <[email protected]>",
25-
"Michael Kuenzli <[email protected]>"
26-
],
27-
"license": "MIT",
28-
"bugs": {
29-
"url": "https://github.com/song940/node-escpos/issues"
30-
},
31-
"homepage": "https://github.com/song940/node-escpos#readme",
32-
"dependencies": {
33-
"qr-image": "*",
34-
"get-pixels": "*",
35-
"iconv-lite": "*",
36-
"mutable-buffer": "^2.0.3"
37-
},
38-
"optionalDependencies": {
39-
"usb": "*",
40-
"serialport": "*",
41-
"node-bluetooth": "*"
42-
},
2+
"name": "root",
3+
"private": true,
434
"devDependencies": {
44-
"mocha": "*"
45-
},
46-
"engines": {
47-
"node": ">=8.x"
48-
},
49-
"directories": {
50-
"doc": "docs",
51-
"example": "examples",
52-
"test": "test"
5+
"lerna": "^3.20.2"
536
}
547
}

packages/adapter/README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
## Adapter
3+
4+
### Constructors
5+
6+
You can choose your adapter type as USB, Serial, Bluetooth, Network, or Console.
7+
8+
### Methods
9+
10+
#### open(function callback[err])
11+
12+
Claims the current device USB (or other device type), if the printer is already in use by other process this will fail and return the error parameter.
13+
14+
By default, the USB adapter will set the first printer found .
15+
16+
Triggers the callback function when done.
17+
18+
#### close(function callback)
19+
20+
Closes the current device and releases its USB interface.
21+
22+
----
File renamed without changes.

packages/adapter/package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "escpos-adapter",
3+
"version": "3.0.0-alpha.1",
4+
"description": "escpos adapter base class",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [
10+
"escpos"
11+
],
12+
"author": "Lsong <[email protected]> (https://lsong.org)",
13+
"license": "MIT",
14+
"gitHead": "a3a65c61c0b990298258331f54546a93d6875ddb"
15+
}

packages/bluetooth/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
#### Bluetooth(address, channel)
3+
```javascript
4+
const escpos = require('escpos');
5+
escpos.Bluetooth = require('escpos-bluetooth');
6+
7+
const address = '01:23:45:67:89:AB';
8+
const channel = 1;
9+
const bluetoothDevice = new escpos.Bluetooth(address, channel);
10+
```
11+
You can scan for printers using the `escpos.Bluetooth.findPrinters()` method. Check out the examples (bt_promise and bt_find_printer) for more information.
File renamed without changes.

packages/bluetooth/package.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "escpos-bluetooth",
3+
"version": "3.0.0-alpha.1",
4+
"description": "bluetooth adapter for escpos",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [
10+
"escpos",
11+
"escpos-adapter"
12+
],
13+
"dependencies": {
14+
"node-bluetooth": "*"
15+
},
16+
"author": "Lsong <[email protected]> (https://lsong.org)",
17+
"license": "MIT",
18+
"gitHead": "a3a65c61c0b990298258331f54546a93d6875ddb"
19+
}
File renamed without changes.

packages/console/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
#### Console(handler = stdout)
3+
```javascript
4+
const escpos = require('escpos');
5+
escpos.Console = require('escpos-console');
6+
7+
const debugDevice = new escpos.Console();
8+
```
File renamed without changes.

packages/console/package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "escpos-console",
3+
"version": "3.0.0-alpha.1",
4+
"description": "console adapter for escpos",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [
10+
"escpos",
11+
"escpos-adapter"
12+
],
13+
"author": "Lsong <[email protected]> (https://lsong.org)",
14+
"license": "MIT",
15+
"gitHead": "a3a65c61c0b990298258331f54546a93d6875ddb"
16+
}

packages/network/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
#### Network(address, port = 9100)
3+
```javascript
4+
const escpos = require('escpos');
5+
escpos.Network = require('escpos-network');
6+
7+
const networkDevice = new escpos.Network('localhost', 3000);
8+
```
9+
The default port number is 9100.
File renamed without changes.

packages/network/package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "escpos-network",
3+
"version": "3.0.0-alpha.1",
4+
"description": "network adapter for escpos",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [
10+
"escpos",
11+
"escpos-adapter"
12+
],
13+
"author": "Lsong <[email protected]> (https://lsong.org)",
14+
"license": "MIT",
15+
"gitHead": "a3a65c61c0b990298258331f54546a93d6875ddb"
16+
}

0 commit comments

Comments
 (0)