# tiny-esc-pos

> Print receipts using Bluetooth through ESC/POS serial commands.

Latest version **0.1.7** (published 2018-05-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install tiny-esc-pos
pnpm add tiny-esc-pos
yarn add tiny-esc-pos
bun add tiny-esc-pos
```

## 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.1.7 |
| Published | 2018-05-11 |
| First published | 2018-04-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Ivan Ray Altomera |
| Maintainers | irayspace |
| Keywords | react-native, bluetooth, printer, esc, pos |

## Links

- npm: https://www.npmjs.com/package/tiny-esc-pos
- Repository: https://github.com/bailabs/tiny-esc-pos
- Homepage: https://github.com/bailabs/tiny-esc-pos#readme
- Issues: https://github.com/bailabs/tiny-esc-pos/issues
- npm.io page: https://npm.io/package/tiny-esc-pos

## Dependencies (1)

- [mutable-buffer](https://npm.io/package/mutable-buffer.md) 2.0.3

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2018-05-11
- 0.1.6 — 2018-05-11
- 0.1.5 — 2018-05-10
- 0.1.4 — 2018-04-17
- 0.1.3 — 2018-04-17
- 0.1.2 — 2018-04-17
- 0.1.1 — 2018-04-17
- 0.1.0 — 2018-04-17

## README

# tiny-esc-pos

A Node.js helper package for using ESC/POS printer.  

## Usage

Using npm

```bash
# Install tiny-esc-pos
npm i tiny-esc-pos --save
```

Then you can import

```js
import TinyPOS from 'tiny-esc-pos';
```

### Example

```js
// This package was mainly created for bluetooth ESC/POS printers
import BluetoothSerial from 'react-native-bluetooth-serial';
import TinyPOS from 'tiny-esc-pos';

// Make sure you are already connected to the printer
const writePromises = [];

// Reset printer format
writePromises.push(BluetoothSerial.write(TinyPOS.init()));

// Write 'Hello World' with new line
writePromises.push(BluetoothSerial.write(
    TinyPOS.bufferedText('Hello World', {
        size: 'doubleheight',
        align: 'center',
        weight: 'bold'
    }, true) // new line
));

// Previously passed config will also take effectt
writePromises.push(BluetoothSerial.write(
    TinyPOS.bufferedText('Simple Receipt Test', {
        size: 'normal',
    })
));

// Add 3 new lines
writePromises.push(BluetoothSerial.write(
    TinyPOS.bufferedLine(3)
));

writePromises.push(BluetoothSerial.write(
    TinyPOS.bufferedText('Sample Receipt')
))

// Offset printing (our test printer won't feed until the end of the printing)
writePromises.push(BluetoothSerial.write(
    TinyPOS.print(2)
));

Promise.all(writePromises)
.then(res => console.log(res))
.catch(err => console.log(err.message));
```

---
_Source: https://npm.io/package/tiny-esc-pos · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
