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

@nikiphoros/capacitor-pos-printer

v1.0.0

Published

A custom Capacitor plugin that integrates the Cashino CSN Thermal Printer Android SDK (CSNPrinterSDK.jar) into Ionic/Angular applications.

Readme

@nikiphoros/capacitor-csn-printer

A custom Capacitor plugin that integrates the Cashino CSN Thermal Printer Android SDK (CSNPrinterSDK.jar) into Ionic / Angular applications.

This plugin enables direct communication with USB POS thermal printers using the official CSN Android SDK.

Tested devices:

  • ASN-A1 (2 inch thermal printer)
  • HOIN (3 inch thermal printer)

⚠️ Android Only
This plugin does NOT support Web or iOS.


Features

  • Connect to CSN USB thermal printers
  • Print text
  • Print images from URL
  • Control text alignment
  • Feed paper
  • Cut paper
  • Reset printer
  • Close printer connection

Platform Support

Platform Supported


Android ✅ iOS ❌ Web ❌


Installation

npm install @nikiphoros/capacitor-csn-printer
npx cap sync

Android Requirements

Your Android device must support USB OTG / USB Host mode.

Add this to AndroidManifest.xml if required:

<uses-feature android:name="android.hardware.usb.host" />

Import Plugin

import { registerPlugin } from '@capacitor/core';

const Csnprinter = registerPlugin('Csnprinter');

or

import { Csnprinter } from '@nikiphoros/capacitor-csn-printer';

Basic Printing Workflow

Typical printing sequence:

  1. Open printer
  2. Set alignment
  3. Print text or image
  4. Feed paper
  5. Cut paper
  6. Close printer

Usage Examples

Open Printer

Opens the USB printer connection and requests permission if required.

await Csnprinter.open();

Print Text

await Csnprinter.textOut({
  text: "Hello World",
  nOrgx: 0,
  nWidth: 0,
  nHight: 0,
  nFtype: 0,
  nFstyle: 0
});

Parameters

Parameter Type Description


text string Text to print nOrgx number Horizontal origin position nWidth number Font width scaling nHight number Font height scaling nFtype number Font type nFstyle number Font style


Align Text

Controls text alignment.

await Csnprinter.align({
  num: 1
});

Alignment Values

Value Alignment


0 Left 1 Center 2 Right


Print Image

Print an image directly from a URL.

await Csnprinter.printPicture({
  URL: "https://yourdomain.com/logo.png"
});

The plugin internally downloads the image and sends it to the printer.


Feed Line

Feeds the paper by one line.

await Csnprinter.feedLine();

Useful for spacing between printed content.


Full Cut Paper

Cuts the paper after printing.

await Csnprinter.fullCutPaper();

Reset Printer

Resets the printer state.

await Csnprinter.reset();

Close Printer

Closes the USB connection to the printer.

await Csnprinter.close();

Complete Example

async function printSample() {

  await Csnprinter.open();

  await Csnprinter.align({ num: 1 });

  await Csnprinter.textOut({
    text: "MY SHOP",
    nOrgx: 0,
    nWidth: 0,
    nHight: 0,
    nFtype: 0,
    nFstyle: 1
  });

  await Csnprinter.feedLine();

  await Csnprinter.align({ num: 0 });

  await Csnprinter.textOut({
    text: "Item 1    100",
    nOrgx: 0,
    nWidth: 0,
    nHight: 0,
    nFtype: 0,
    nFstyle: 0
  });

  await Csnprinter.feedLine();

  await Csnprinter.textOut({
    text: "Total: 100",
    nOrgx: 0,
    nWidth: 0,
    nHight: 0,
    nFtype: 0,
    nFstyle: 1
  });

  await Csnprinter.feedLine();
  await Csnprinter.feedLine();

  await Csnprinter.fullCutPaper();

  await Csnprinter.close();
}

API Reference

open()

Opens printer connection.

open() => Promise<void>

align()

Set text alignment.

align({ num: number })

textOut()

Print text.

textOut({
  text: string,
  nOrgx: number,
  nWidth: number,
  nHight: number,
  nFtype: number,
  nFstyle: number
})

printPicture()

Print image from URL.

printPicture({
  URL: string
})

feedLine()

Feeds paper.

feedLine()

fullCutPaper()

Cuts the paper.

fullCutPaper()

reset()

Reset printer.

reset()

close()

Close printer connection.

close()

Tested Printers

  • ASN-A1 (2 inch thermal printer)
  • HOIN (3 inch thermal printer)

Other CSN SDK compatible printers may also work.


Notes

  • Printer must be connected via USB OTG
  • The application will automatically request USB permission
  • Only compatible with CSN Printer SDK based devices

License

MIT


Author

Nikhil Shende

GitHub
https://github.com/nikiphoros