@h0me/tp-server
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

🧾tp-server

A Thermal Printer server and MQTT client providing a markup-like api interface around the `escpos' library.

An example HTTP request would look like...

POST /job HTTP/1.1
Host: 192.168.1.23:3000
Content-Type: text/plain

font "a"
size "2" "2"
align "ct"
style "bu"
text "Hi!"
size "0" "0"
text "A little test print for you!"
text "Have a barcode"
barcode "1234567" "EAN8"
cut

More commands can be found at the escpos repo.

🏃‍♀️ Run the server

To start the server, you can install globally, or use npx

npm install -g @h0me/tp-server
tp-server examples/config.js
npx @h0me/tp-server examples/config.js

🖨️ Print!

HTTP

curl --location --request POST 'http://192.168.1.23:3000/job' \
--header 'Content-Type: text/plain' \
--data-raw 'font "a"
size "2" "2"
text "Hi!"
cut'

MQTT

mqtt pub -t "h0me/tp-server" -m 'font "a"
size "2" "2"
text "Hi!"
cut'

Readme

Keywords

none

Package Sidebar

Install

npm i @h0me/tp-server

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

23.3 kB

Total Files

33

Last publish

Collaborators

  • moonthug_user