npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@centimoo/capacitor-tcp-printer

v1.0.0

Published

Native TCP printer plugin for Capacitor using Apple Network.framework. Enables raw socket printing (ESC/POS) to LAN printers on iOS.

Readme

@centimoo/capacitor-tcp-printer

Native TCP printer plugin for Capacitor using Apple Network.framework. Enables raw socket printing (ESC/POS) to LAN printers on iOS.

Install

npm install @centimoo/capacitor-tcp-printer
npx cap sync

API

TCP Socket Plugin interface for Capacitor Provides methods for TCP socket communication

connect(...)

connect(options: ConnectOptions) => Promise<ConnectResult>

Connects to a TCP server

| Param | Type | Description | | ------------- | --------------------------------------------------------- | ------------------------------------------------ | | options | ConnectOptions | Connection options including IP address and port |

Returns: Promise<ConnectResult>


send(...)

send(options: SendOptions) => Promise<void>

Sends data to a connected TCP server

| Param | Type | Description | | ------------- | --------------------------------------------------- | --------------------------------------------------- | | options | SendOptions | Send options including client ID, data and encoding |


read(...)

read(options: ReadOptions) => Promise<ReadResult>

Reads data from a connected TCP server

| Param | Type | Description | | ------------- | --------------------------------------------------- | ------------------------------------------------------------- | | options | ReadOptions | Read options including client ID, expected length and timeout |

Returns: Promise<ReadResult>


disconnect(...)

disconnect(options: DisconnectOptions) => Promise<DisconnectResult>

Disconnects from a TCP server

| Param | Type | Description | | ------------- | --------------------------------------------------------------- | --------------------------------- | | options | DisconnectOptions | Disconnect options with client ID |

Returns: Promise<DisconnectResult>


Interfaces

ConnectResult

Result of a successful connection

| Prop | Type | Description | | ------------ | ------------------- | ---------------------------------------------------- | | client | number | Client ID that can be used for subsequent operations |

ConnectOptions

Options for connecting to a TCP server

| Prop | Type | Description | Default | | --------------- | ------------------- | -------------------------------------- | ----------------- | | ipAddress | string | IP address of the server to connect to | | | port | number | Port number of the TCP server | 9100 |

SendOptions

Options for sending data to a TCP server

| Prop | Type | Description | Default | | -------------- | ----------------------------------------------------- | -------------------------------------- | ------------------------------ | | client | number | Client ID from a previous connect call | | | data | number[] | Data string to send to the server | | | encoding | DataEncoding | Encoding type for the data | DataEncoding.UTF8 |

ReadResult

Result of a read operation

| Prop | Type | Description | | -------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | result | string | Data read from the server Can be UTF-8 string, Base64 encoded string, or Hex string depending on the encoding option | | encoding | DataEncoding | The encoding of the returned result |

ReadOptions

Options for reading data from a TCP server

| Prop | Type | Description | Default | | --------------- | ----------------------------------------------------- | -------------------------------------- | ------------------------------ | | client | number | Client ID from a previous connect call | | | expectLen | number | Expected number of bytes to read | | | timeout | number | Read timeout in seconds | 10 | | encoding | DataEncoding | Preferred encoding for returned data | DataEncoding.UTF8 |

DisconnectResult

Result of a disconnect operation

| Prop | Type | Description | | ------------ | ------------------- | ------------------------------- | | client | number | Client ID that was disconnected |

DisconnectOptions

Options for disconnecting from a TCP server

| Prop | Type | Description | | ------------ | ------------------- | -------------------------------------- | | client | number | Client ID from a previous connect call |

Enums

DataEncoding

| Members | Value | Description | | ------------ | --------------------- | ------------------- | | UTF8 | 'utf8' | UTF-8 text encoding | | BASE64 | 'base64' | Base64 encoded data | | HEX | 'hex' | Hexadecimal string |