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 🙏

© 2024 – Pkg Stats / Ryan Hefner

rn-epson-tm82

v1.2.1

Published

Epson TM-T82 Library (WIFI UNIT ONLY).

Downloads

5

Readme

react-native-epson-tm82

React-Native plugin for Epson POS printer Model TM-T82 Ethernet (Android Only).

Any questions or bug please raise a issue.

##Still under development

Installation

Step 1

Install via NPM

npm install rn-epson-tm82 --save

or install via Yarn

yarn add rn-epson-tm82 --save

Step 2

Link the plugin to your RN project

react-native link rn-epson-tm82

Or you may need to link manually

on your android/settings.gradle

...
include ':rn-epson-tm82'
project(':rn-epson-tm82').projectDir = new File(rootProject.projectDir, '../node_modules/rn-epson-tm82/android')

on your android/app/build.gradle

...
dependencies{
  ...
  implementation project(':rn-epson-tm82')
}

on your android/app/src/main/java/com/yourpackagename/MainApplication.java

Import Section

import com.nowarzz.rnepson.RNReactNativeEpsonTm82Package;
...

protected List<ReactPackage> getPackages() {
  ...
  ,new RNReactNativeEpsonTm82Package()
}

Step 3

Refers to your JS files

  import TM from 'rn-epson-tm82';

Usage and APIs

Printer

  • initialize ==> To initialize printer configuration
await TM.initialize();

*writeText ==> Add text to printer buffer //TODO: add parameter to customize text

const option = {
  bold: true,
  fontSize:2
}
await TM.writeText("My Label Here",option);

Options for write text

bold

true or false

fontSize

range of 1 to 8. Max 8. Standard usage is between 1 to 2.

*printColumn ==> Split text based on column //TODO: add parameter to customize text

const column = [16,16,16];
const align =[TM.ALIGN_LEFT,TM.ALIGN_CENTER,TM.ALIGN_RIGHT];
await TM.printColumn(column,align,["Align Left","Align Center","Align Right"],{});

*writeQRCode ==> Add QR Code to buffer.

const msg = "QRCODE TEXT";
await TM.writeQRCode(msg);

*writeImage ==> Add image to buffer. Accept only base64 string

const image = "BASE64 encoded string";
await TM.writeImage(image,options);

Options for image

width

label width. height will auto calculate based on image ratio

*writeFeed ==> Add feed to paper

await TM.writeFeed(1);

*writeCut ==> Cut paper

await TM.writeCut();

*startPrint ==> Start printing from the feed to target IP address

await TM.startPrint(ipAddress);

Options for start print

ipAddress

IP Address on String "000.000.000.000" format. Example: "192.168.192.168"

Discovery

*Initialize ==> Initialize Discovery searching

await TM.initializeDiscovery();

*Start Discovery ==> Start to Discover Printer

await TM.startDiscovery();

*Stop Discovery ==> Stop to Discover Printer

await TM.stopDiscovery();

//TODO: add test print script

Demos of printing receipt


await TM.initialize();
await TM.writeText("My Restaurant Cafe\n");
await TM.writeText("------------------------------------------------\n");
const column = [4, 26, 9, 9];
const align = [2, 0, 2, 2];
await TM.printColumn(column, align, [`Qty`, "Item Name", "Price", "Amount"], {});
await TM.writeText("------------------------------------------------\n");
await TM.printColumn(column, align, [`1`, "Rice", "$1.0", "$1.0"], {});
await TM.printColumn(column, align, [`2`, "Ice Water", "$1.0", "$2.0"], {});
await TM.printColumn(column, align, [`3`, "Espresso", "$1.0", "$3.0"], {});
await TM.printColumn(column, align, [`4`, "Banana Split", "$1.0", "$4.0"], {});
await TM.printColumn(column, align, [`5`, "Tenderloin Steak", "$1.0", "$5.0"], {});
await TM.printColumn(column, align, [`6`, "Soup of the day", "$1.0", "$6.0"], {});
await TM.writeText("------------------------------------------------\n");
const totalColumn = [30,18];
const totalAlign = [0,2];
await TM.printColumn(totalColumn,totalAlign,["Total","$21.0"],{});
await TM.writeFeed(2);
await TM.writeText("Thank you. Please come back again");
await TM.startPrint();

For Proguard-Rules

if you are using Proguard on Release, add this syntax to your android/app/proguard-rules.pro

-keep class com.epson.** {*;} 
-dontwarn com.epson.**