# nativescript-escpos-printer

> ESCPOS printer for NativeScript

Latest version **2.0.1** (published 2020-03-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install nativescript-escpos-printer
pnpm add nativescript-escpos-printer
yarn add nativescript-escpos-printer
bun add nativescript-escpos-printer
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2020-03-01 |
| First published | 2020-02-16 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 100 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Hans Bakker |
| Maintainers | hansbak |
| Keywords | POS printer, socket, nativescript, javascript, swift, java, IOS, Android |

## Links

- npm: https://www.npmjs.com/package/nativescript-escpos-printer
- Repository: https://github.com/growerp/nativescript-escpos-printer
- Issues: https://github.com/growerp/nativescript-escpos-printer/issues
- npm.io page: https://npm.io/package/nativescript-escpos-printer

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2020-03-01
- 2.0.0 — 2020-03-01
- 1.0.0 — 2020-02-16
- 0.9.9 — 2020-02-16

## README

# nativescript-escpos-printer

Provide a generic printer plugin for ESCPOS thermal printers for android and IOS

This plug is based on:
nativescript-ichi-printer
and ideas used from:
https://www.raywenderlich.com/3437391-real-time-communication-with-streams-tutorial-for-ios#toc-anchor-004

This works for Android and IOS and includes full source (swift/java)

use the included printer simulation to show the printouts.

## Installation

```javascript
tns plugin add nativescript-escpos-printer
```

## Usage

```javascript
import { Printer } from 'nativescript-escpos-printer';
import { isIOS } from 'tns-core-modules/platform';
var printer = new Printer
printer.print(isIOS? 'localhost' : '10.0.2.2', 9100, "Print test String!")
.then( result => {
    if (!result) alert("printer error!")
})
```

## API

## License

Apache License Version 2.0, January 2004

## known problems
in IOS, the app will get stuck when a printer is defined, but not found or switched off.
(looks like outputStream.hasSpaceAvailable in IOS swift, always returns false, even if connected)

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