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

@cacio/react-native-bluetooth-escpos-printer

v1.0.2

Published

React-Native plugin for the bluetooth ESC/POS printers.

Downloads

22

Readme

@cacio/react-native-bluetooth-escpos-printer

Fork ajustado de januslo/react-native-bluetooth-escpos-printer Compatível com Gradle atualizado e Android 13+.

npm version

Biblioteca React Native para integração com impressoras Bluetooth ESC/POS & TSC. Ideal para recibos, etiquetas e integração com dispositivos Android.


✨ Features

  • Suporte a ESC/POS (recibos) e TSC (etiquetas)
  • Gerenciamento de Bluetooth (parear, conectar, listar dispositivos)
  • Compatível com TypeScript
  • Testado principalmente em Android
  • Em desenvolvimento ativo

📦 Instalação

1. Instalar pacote

npm install @cacio/react-native-bluetooth-escpos-printer
# ou
yarn add @cacio/react-native-bluetooth-escpos-printer

2. Link (apenas RN < 0.60)

react-native link @cacio/react-native-bluetooth-escpos-printer

Para React Native 0.60+, o autolinking cuida disso automaticamente ✅.

3. Importar no projeto

import {
  BluetoothManager,
  BluetoothEscposPrinter,
  BluetoothTscPrinter
} from '@cacio/react-native-bluetooth-escpos-printer';

🚀 Uso rápido

Verificar se Bluetooth está ativo

const enabled = await BluetoothManager.checkBluetoothEnabled();
console.log(enabled); // true | false

Ativar e listar dispositivos pareados

const devices = await BluetoothManager.enableBluetooth();

Escanear novos dispositivos

const { found, paired } = JSON.parse(await BluetoothManager.scanDevices());

Conectar a um dispositivo

await BluetoothManager.connect("XX:XX:XX:XX:XX:XX");

Imprimir texto simples

await BluetoothEscposPrinter.printText("Olá, mundo!\n\r", {
  encoding: 'GBK',
  widthtimes: 1,
  heigthtimes: 1,
  fonttype: 0,
});

Imprimir etiqueta TSC

await BluetoothTscPrinter.printLabel({
  width: 40,
  height: 30,
  text: [
    {
      text: "Etiqueta Teste",
      x: 20,
      y: 20,
      fonttype: BluetoothTscPrinter.FONTTYPE.SIMPLIFIED_CHINESE,
      rotation: BluetoothTscPrinter.ROTATION.ROTATION_0,
      xscal: BluetoothTscPrinter.FONTMUL.MUL_1,
      yscal: BluetoothTscPrinter.FONTMUL.MUL_1,
    }
  ],
});

📚 APIs disponíveis


🔧 BluetoothManager

Funções principais:

  • checkBluetoothEnabled() → verifica se Bluetooth está ativo
  • enableBluetooth() → ativa e retorna dispositivos pareados
  • scanDevices() → procura novos dispositivos
  • connect(address) → conecta a um dispositivo
  • disconnect(address) → desconecta
  • getConnectedDeviceAddress() → retorna o endereço atual
  • unpair(address) → desfaz pareamento

Eventos emitidos: EVENT_DEVICE_ALREADY_PAIRED, EVENT_DEVICE_FOUND, EVENT_CONNECTED, EVENT_CONNECTION_LOST, etc.


🖨️ BluetoothTscPrinter

Usado para etiquetas. Principais métodos:

  • printLabel(options) → imprime etiqueta (texto, QRCode, imagem, etc.)

🧾 BluetoothEscposPrinter

Usado para recibos ESC/POS. Principais métodos:

  • printerInit()
  • printText(text, options)
  • printColumn(cols, aligns, texts, options)
  • printQRCode(content, size, correctionLevel)
  • printBarCode(...)
  • printPic(base64, options)
  • cutOnePoint()
  • openDrawer(pin, onTime, offTime)

🐞 Contribuição

Achou um bug ou precisa de uma melhoria? Abra uma issue ou envie um PR 🚀


📜 Licença

MIT © cacio