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

react-native-brother-print

v1.0.3

Published

React Native module for printing with Brother printers via WiFi and Bluetooth

Readme

react-native-brother-print

A React Native module for printing labels on Brother printers via WiFi and Bluetooth. Supports QL series and other Brother label printers with advanced image processing options.

Installation

npm install react-native-brother-print

or using yarn:

yarn add react-native-brother-print

Brother SDK Setup (Android Only)

This library requires the Brother Print SDK, which must be provided by your application due to licensing requirements.

  1. Visit Brother's Developer Program
  2. Register/Login and download the Brother Print SDK for Android
  3. Extract the .aar file from the SDK
  4. Create a libs directory in your app's android directory:
    mkdir -p android/app/libs
  5. Copy the Brother SDK .aar file to this directory
  6. Add the following to your app's android/app/build.gradle:
android {
    // ... your existing android config
}

repositories {
    // ... your existing repositories
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    // ... your existing dependencies
    implementation files('libs/BrotherPrintLibrary.aar')  // Use the actual filename of your .aar file
}
  1. (Optional) If you placed the Brother SDK in a different location, you can configure the path in your app's root android/build.gradle:
buildscript {
    ext {
        // ... your other ext properties
        brotherSdkPath = "${rootProject.projectDir}/some/path/to/libs" // Adjust this if you placed the SDK somewhere else
    }
    // ... rest of your buildscript
}

iOS Setup

Run pod install:

cd ios && pod install

Required Permissions

iOS

Add the following permissions to your Info.plist:

<!-- Bluetooth permissions -->
<key>NSBluetoothPeripheralUsageDescription</key>
<string>Find paired Brother printers</string>

<key>NSBluetoothAlwaysUsageDescription</key>
<string>Find paired Brother printers</string>

<!-- WiFi permissions -->
<key>NSLocalNetworkUsageDescription</key>
<string>Find Brother printers installed in the local network</string>
<key>NSBonjourServices</key>
<array>
    <string>_pdl-datastream._tcp</string>
    <string>_printer._tcp</string>
    <string>_ipp._tcp</string>
</array>

Android

Add the following permissions to your AndroidManifest.xml:

<!-- Bluetooth permissions -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />

<!-- WiFi permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Usage

Basic Print via WiFi

import { printImageViaWifi } from "react-native-brother-print";

try {
  const ipAddress = '192.168.1.100';  // Your printer's IP address
  const modelName = 'QL-820NWB';      // Your printer's model name
  const imageUri = 'file:///path/to/your/image.png';  // Local file URI
  
  await printImageViaWifi(imageUri, ipAddress, modelName);
  console.log('Print successful');
} catch (error) {
  console.error('Print failed:', error);
}

Basic Print via Bluetooth

import { printImageViaBluetooth } from "react-native-brother-print";

try {
  const modelName = 'QL-820NWB';      // Your printer's model name
  const imageUri = 'file:///path/to/your/image.png';  // Local file URI
  
  await printImageViaBluetooth(imageUri, modelName);
  console.log('Print successful');
} catch (error) {
  console.error('Print failed:', error);
}

Black-and-White Conversion Options

For badge printing or scenarios where you need pure black-and-white output, you can use the halftone and thresholdingValue options to control how color images are converted to black-and-white:

import { printImageViaWifi } from "react-native-brother-print";

try {
  const ipAddress = '192.168.1.100';
  const modelName = 'QL-820NWB';
  const imageUri = 'file:///path/to/your/badge-image.png';
  
  // Convert to pure black-and-white with adjustable contrast
  const options = {
    halftone: 'THRESHOLD',        // Force binary cutoff
    thresholdingValue: 128        // Adjust cutoff point (0-255)
  };
  
  await printImageViaWifi(imageUri, ipAddress, modelName, options);
  console.log('Black-and-white print successful');
} catch (error) {
  console.error('Print failed:', error);
}

Print Options

| Option | Type | Values | Description | |--------|------|---------|-------------| | halftone | string | 'THRESHOLD', 'ERROR_DIFFUSION', 'PATTERN_DITHER' | Controls how images are converted to black-and-white | | thresholdingValue | number | 0-255 | Adjusts the black-white cutoff point (lower = more black, higher = more white) |

Halftone Methods

  • THRESHOLD: Creates pure black-and-white output with a hard cutoff. Best for badge printing and text.
  • ERROR_DIFFUSION: Uses dithering to create the appearance of gradients. Better for photos.
  • PATTERN_DITHER: Uses pattern-based dithering. Alternative method for gradients.

Examples for Different Use Cases

Badge/ID Card Printing (Pure B&W):

const badgeOptions = {
  halftone: 'THRESHOLD',
  thresholdingValue: 128  // Balanced cutoff
};

High Contrast Badge (More Black):

const highContrastOptions = {
  halftone: 'THRESHOLD',
  thresholdingValue: 100  // Lower value = more pixels become black
};

Photo Printing with Dithering:

const photoOptions = {
  halftone: 'ERROR_DIFFUSION',
  thresholdingValue: 128
};

Supported Printer Models

This module supports the following Brother printer models:

  • QL Series: QL-820NWB, QL-820NWBc, QL-1110NWB, QL-1110NWBc
  • PJ Series: PJ-763MFi, PJ-862, PJ-863, PJ-883
  • MW Series: MW-145MFi, MW-260MFi
  • RJ Series: RJ-2035B, RJ-2050, RJ-2150, RJ-3035B, RJ-3050Ai, RJ-3150Ai, RJ-3230B, RJ-3250WB, RJ-4030Ai, RJ-4230B, RJ-4250WB
  • TD Series: TD-2125NWB, TD-2135NWB, TD-4550DNWB
  • PT Series: PT-P910BT

Notes

License

MIT