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

flair-printer

v0.0.12

Published

This plugin allows printing receipts via USB (ESCPOS)

Readme

flair-printer

This plugin allows printing receipts via USB (ESCPOS)

Install

npm install flair-printer
npx cap sync

API

getPrinters()

getPrinters() => Promise<{ printers: Printer[]; }>

Returns: Promise<{ printers: Printer[]; }>


scanUsbPrinters()

scanUsbPrinters() => Promise<{ printers: USBPrinter[]; }>

Returns: Promise<{ printers: USBPrinter[]; }>


setPrinter(...)

setPrinter({ printer }: { printer: Printer; }) => Promise<PrinterResult>

| Param | Type | | --------- | --------------------------------------------------------- | | __0 | { printer: Printer; } |

Returns: Promise<PrinterResult>


removePrinter(...)

removePrinter({ printerId }: { printerId: string; }) => Promise<PrinterResult>

| Param | Type | | --------- | ----------------------------------- | | __0 | { printerId: string; } |

Returns: Promise<PrinterResult>


printReceipt(...)

printReceipt({ printerId, data, }: { printerId: string; data: { raw: number[]; logo?: string; }; }) => Promise<PrinterResult>

| Param | Type | | --------- | ---------------------------------------------------------------------------- | | __0 | { printerId: string; data: { raw: number[]; logo?: string; }; } |

Returns: Promise<PrinterResult>


warmUp(...)

warmUp(options?: { simulated?: boolean | undefined; } | undefined) => Promise<void>

Prime the Stripe Terminal SDK in the background so the first payment is fast. Call this on app/device page load with the connectionTokenNeeded listener already set up. Fire-and-forget — resolves immediately while warmup runs in the background.

| Param | Type | | ------------- | ------------------------------------- | | options | { simulated?: boolean; } |


executeTapAndPay(...)

executeTapAndPay(options: TapAndPayOptions) => Promise<TapAndPayResult>

| Param | Type | | ------------- | ------------------------------------------------------------- | | options | TapAndPayOptions |

Returns: Promise<TapAndPayResult>


provideConnectionToken(...)

provideConnectionToken(options: { token: string; }) => Promise<void>

Supply a fresh connection token to the Stripe Terminal SDK. Call this in response to the fetchConnectionToken event (re-auth / reconnect scenarios).

| Param | Type | | ------------- | ------------------------------- | | options | { token: string; } |


addListener('connectionTokenNeeded', ...)

addListener(eventName: 'connectionTokenNeeded', listenerFunc: () => void) => Promise<PluginListenerHandle>

Fired by the native plugin every time the Stripe Terminal SDK needs a fresh connection token (on init, discovery, connect, and any SDK reconnect). Fetch a new token from your backend and call provideConnectionToken().

| Param | Type | | ------------------ | ------------------------------------ | | eventName | 'connectionTokenNeeded' | | listenerFunc | () => void |

Returns: Promise<PluginListenerHandle>


setServerUrl(...)

setServerUrl(options: { url: string; }) => Promise<void>

Persist a new server URL and immediately navigate the WebView to it.

| Param | Type | | ------------- | ----------------------------- | | options | { url: string; } |


getServerUrl()

getServerUrl() => Promise<{ url: string | null; }>

Return the currently-saved server URL, or null if none is stored (falls back to build-time default).

Returns: Promise<{ url: string | null; }>


clearServerUrl()

clearServerUrl() => Promise<void>

Clear the saved server URL and open the env picker so the user can choose a new one.


openEnvPicker()

openEnvPicker() => Promise<void>

Load the environment-switcher page (launcher.html) over the current WebView.


Interfaces

Printer

| Prop | Type | | -------------------- | --------------------------------------------------- | | id | string | | name | string | | type | PrinterType | | connectionInfo | string | | lineWidth | number |

USBPrinter

| Prop | Type | | --------------- | ------------------- | | vendorId | string | | productId | string |

PrinterResult

| Prop | Type | | ------------- | -------------------- | | success | boolean | | message | string |

TapAndPayResult

| Prop | Type | Description | | --------------------- | ----------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | status | 'error' | 'succeeded' | 'requires_capture' | 'canceled' | succeeded — payment done (auto-capture PI) requires_capture — collected, call POST /capture on your backend with paymentIntentId canceled — user pressed Cancel on the overlay error — something failed, check errorMessage | | paymentIntentId | string | PaymentIntent ID — present for succeeded / requires_capture / canceled | | errorMessage | string | | | errorCode | string | |

TapAndPayOptions

| Prop | Type | Description | | ------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------- | | paymentIntentClientSecret | string | Client secret of a PaymentIntent created on your backend (payment_method_types: ['card_present']) | | locationId | string | Stripe Terminal location ID belonging to the connected account | | merchantDisplayName | string | Business name shown on the native payment overlay | | simulated | boolean | Use simulated reader — for testing only, no real card needed. Defaults to false. |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

Type Aliases

PrinterType

'USB' | 'HTTP'