# @h0me/tp-server

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

Latest version **0.2.1** (published 2021-03-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @h0me/tp-server
pnpm add @h0me/tp-server
yarn add @h0me/tp-server
bun add @h0me/tp-server
```

Provides the command `tp-server`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2021-03-20 |
| First published | 2021-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 22.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Coulcher |
| Maintainers | moonthug_user |

## Links

- npm: https://www.npmjs.com/package/@h0me/tp-server
- Repository: https://github.com/moonthug/tp-server
- Homepage: https://github.com/moonthug/tp-server#readme
- Issues: https://github.com/moonthug/tp-server/issues
- npm.io page: https://npm.io/package/@h0me/tp-server

## Dependencies (8)

- [koa](https://npm.io/package/koa.md) ^2.13.1
- [bull](https://npm.io/package/bull.md) ^3.20.1
- [mqtt](https://npm.io/package/mqtt.md) ^4.2.6
- [escpos](https://npm.io/package/escpos.md) ^3.0.0-alpha.6
- [escpos-usb](https://npm.io/package/escpos-usb.md) ^3.0.0-alpha.4
- [koa-router](https://npm.io/package/koa-router.md) ^10.0.0
- [koa-bodyparser](https://npm.io/package/koa-bodyparser.md) ^4.3.0
- [http-status-codes](https://npm.io/package/http-status-codes.md) ^2.1.4

## Recent versions

- 0.2.1 (latest) — 2021-03-20
- 0.2.0 — 2021-03-13
- 0.1.0 — 2021-03-13

## README

# 🧾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...

```http request
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](https://www.npmjs.com/package/escpos).

## 🏃‍♀️ Run the server

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

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


```shell
npx @h0me/tp-server examples/config.js
```

## 🖨️ Print!

### HTTP

```shell
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

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

---
_Source: https://npm.io/package/@h0me/tp-server · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
