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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-expo-ezprinter

v1.0.3

Published

Goodcom Printer sdk for react-native-expo(TypeScript)

Downloads

9

Readme

This is a new React Native project, bootstrapped using @react-native-community/cli.

Getting Started

Note: Make sure you have completed the [expo - Environment Setup] before proceeding.

Step 1: Installation

npm install react-native-expo-ezprinter --save

or

yarn add react-native-expo-ezprinter

Step 2: install plugin expo-build-properties

    npx expo install expo-build-properties

Step 3: Declare the plugin in 'app. json' and pass in minSdkVersion

{
  "expo": {
    "name": "expo-app",
    "slug": "expo-app",
    "plugins": [
      [
        "expo-build-properties",
        {
          "android": {
            "minSdkVersion": 26
          }
        }
      ]
    ]
  }
}

Step 4:Initialize the plugin and generate native Android code (required for first use)

  npx expo prebuild --clean

Step 5: Import in React-Native

import EzPrinter, {FontSize, AlignmentType, BarcodeType} from 'react-native-expo-ezprinter';

API

Constants

FontSize : font size AlignmentType : Alignment Type BarcodeType : Barcode Type | Type | Sub type | |:-----:|:-----------:| |FontSize |Default,Small,Medium,Big,DoubleHeight,DoubleWidth,SmallBold,MediumBold,BigBold,DoubleHeightBold,DoubleWidthBold | |AlignmentType |Left,Center,Right | |BarcodeType |barcodeUpca,barcodeUpce,barcodeEan8,barcodeEan13,barcodeCode128,barcodeCode39,barcodeCodeBar,barcodeItf,barcodeCode93,barcodeQrCode |

Method

| Method | Parameter | Return Type | |:-----:|:-----------:|:-----------:| | drawText |strLeft, fontLeft, strMid, fontMid, strRight, fontRight | void | | printText |isAutoFeed | void | | drawLeftRight |strLeft, fontLeft, strRight, fontRight | void | | drawCustom |string, fontSize, align | void | | drawNewLine | | void | | drawOneLine |fontSize | void | | drawOneLineDefault | | void | | drawBarcode |str, align, type | void | | drawBarcodeWithHeight |string, align, type, height | void | | drawQrCode |string, align | void | | drawQrCodeWithHeight |string,align,height | void | | isDeviceSupport | | Promise<number> | | printJson |json | void | | printImageByBase64 |base64, align, isAutoFeed | void | | printImageByArray |byteArray, align, isAutoFeed | void |


  /**
   * Draw text into memory, you can specify the position and font size of the printed text, and you can print the left, middle, and right text at the same line
   * You can continuously use drawText to draw all the contents into memory, and finally use printText to print the contents.
   */
  drawText: (strLeft, fontLeft, strMid, fontMid, strRight, fontRight) => void,
 /**
   * Start printing. Except for image printing, other APIs, such as drawText, just draw the printing content in the memory first, and the printing has not been started yet.
   * This method is to print out the printing content in the memory.Control whether to automatically feed paper through isAutoFeed
   */
  printText: (isAutoFeed) => void,
  /**
   * Draw text into memory, you can print left-aligned and right-aligned content at the same line. It needs to be printed using printText.
   */
  drawLeftRight: (strLeft, fontLeft, strRight, fontRight) => void,
  /**
   * Draw text content to memory, you can specify the size and position of the content. It needs to be printed using printText.
   */
  drawCustom: (string, fontSize, align) => void,
  /**
   * Draw a blank line, similar to a newline.
   */
  drawNewLine: () => void,
  /**
   * Draw a horizontal line, you can specify the thickness of the horizontal line by setting the font size.
   */
  drawOneLine: (fontSize) => void,
  /**
   * Draw a horizontal line, use the default font without specifying the font size
   */
  drawOneLineDefault: () => void,
  /**
   * Draw barcodes, including qrcode, you can specify the alignment position and barcode type of the barcode.
   */
  drawBarcode: (str, align, type) => void,
  /**
   * Draw barcodes, including qrcode, you can specify the alignment position and barcode type of the barcode.
   * The height of the barcode can be specified. No width parameter is required, the width is determined by the specific barcode
   */
  drawBarcodeWithHeight: (string, align, type, height) => void,
   /**
   * Draw qrcode,you can specify the alignment position of the qrcode.
   */
  drawQrCode: (string, align) => void;
  /**
   * Draw qrcode,you can specify the alignment position of the qrcode.
   * The height of the qrcode can be specified. No width parameter is required, the width is determined by the specific qrcode
   */
  drawQrCodeWithHeight: (string,align,height) => void;  
  /**
   * Check whether printing is supported. This method returns true only on goodcom printers. This method allows the app to distinguish printers from different manufacturers.
   */
  isDeviceSupport: () => Promise<string>,
  /**
   * Print the content in json format, which will be parsed by the printer according to the template and formatted for printing
   */
  printJson: (json) => void,
  /**
   * Printing an image using base64 encoding, the Base64 string must start with "data:image/png;base64,"
   * You can set the alignment position of the printed image, and decide whether to automatically feed the paper after printing.
   * If you want to print the text after printing the image, the paper will not be automatically fed.
   */
  printImageByBase64: (base64, align, isAutoFeed) => void,