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

drawer-pulse

v1.0.1

Published

Professional Cordova app for opening cash drawers on iOS and Android devices. Supports Network (WiFi/Ethernet) and USB (Android only) connections using ESC/POS protocol.

Readme

DrawerPulse

npm version License Downloads Buy Me A Coffee

Smart Cash Drawer Control for Modern POS Systems

Professional Cordova app for opening cash drawers on iOS and Android devices Supports Network (WiFi/Ethernet) and USB (Android only) connections using ESC/POS protocol

InstallationFeaturesUsageAPISupport

Organized by Flenco.in


Features

  • Multi-Protocol Support: Standard ESC/POS, Epson, Star Micronics with auto-detection
  • Network Connection: WiFi/Ethernet (iOS & Android)
  • USB Connection: USB OTG (Android only)
  • Cross-Platform: Optimized for both iOS and Android
  • Modern UI: Clean Ubuntu-style grey theme
  • Comprehensive Error Handling: Detailed troubleshooting messages
  • Production Ready: Tested and battle-hardened

Installation

NPM Package

npm install drawer-pulse

From Source

# Clone the repository
git clone https://github.com/flenco-in/drawer-pulse.git
cd drawer-pulse

# Install dependencies
npm install

# Setup platforms
npm run setup:android  # Add Android platform
npm run setup:ios      # Add iOS platform (macOS only)

Prerequisites

  • Node.js 16+ and npm
  • Cordova CLI: npm install -g cordova
  • iOS: Xcode 14+ (macOS only)
  • Android: Android Studio with SDK 34+
  • Gradle: Install via SDKMAN - sdk install gradle 8.10.2

Quick Start

Build & Run

# Android
npm run build:android    # Build APK
npm run run:android      # Build and run on device/emulator
npm run start:android    # Start emulator and run app

# iOS (macOS only)
npm run build:ios        # Build iOS app (device only)
npm run run:ios          # Build and run on device/simulator

# Important: iOS builds with Xcode 26 require using Xcode GUI
# See IOS_BUILD_NOTES.md for details

# Clean build cache (if build issues)
npm run clean

Usage

Network Connection (WiFi/Ethernet) - Recommended

  1. Find printer IP address (check printer settings or router)
  2. Open app → Select "Network"
  3. Enter IP: 192.168.1.100 and Port: 9100
  4. Click "Connect to Printer"
  5. Click "OPEN DRAWER" (auto-detects protocol)

USB Connection (Android Only)

  1. Connect printer via USB OTG cable
  2. Open app → Select "USB"
  3. Click "Connect USB Device"
  4. Grant permissions → Select device
  5. Click "OPEN DRAWER"

Note: USB is disabled on iOS as it's not supported by the platform.

Architecture

drawer-pulse/
├── www/
│   ├── index.html              # Main UI
│   ├── js/
│   │   ├── index.js            # App logic
│   │   ├── cash-drawer-api.js  # Unified API
│   │   └── modules/
│   │       ├── escpos-commands.js    # ESC/POS protocol
│   │       ├── usb-handler.js        # USB communication
│   │       └── network-handler.js    # Network communication
├── platforms/                  # iOS & Android
├── config.xml                  # Cordova configuration
└── package.json

Supported Protocols

| Protocol | Description | Compatible Printers | |----------|-------------|-------------------| | Standard ESC/POS | Universal | Most ESC/POS printers | | Epson | Epson TM series | TM-T88, TM-T20, etc. | | Star Micronics | Star TSP series | TSP650, TSP700, etc. |

API Reference

CashDrawerAPI

const api = new CashDrawerAPI();

// Connect via network
await api.connectNetwork('192.168.1.100', 9100);

// Connect via USB (Android only)
await api.connectUSB();

// Open drawer with auto-detection
await api.openDrawer('standard');  // 'epson', 'star', 'alt', 'all'

// Get status
const status = api.getStatus();

// Disconnect
await api.disconnect();

ESCPOSCommands

const escpos = new ESCPOSCommands();

// Generate commands
const cmd = escpos.openCashDrawer(0, 25, 250);
const epsonCmd = escpos.openCashDrawerEpson();

// Get all commands
const allCommands = escpos.getAllCommands();

Troubleshooting

iOS Issues

Build fails with Xcode 26?

App feels slow?

  • Clean build in Xcode (Cmd+Shift+K)
  • Restart iPhone
  • Check iOS version (requires 13.0+)

USB not working?

  • USB is not supported on iOS (platform limitation)
  • Use Network connection instead

Android Issues

Build fails with Gradle error?

npm run clean
npm run setup:android
npm run build:android

USB device not detected?

  • Check USB OTG cable
  • Grant USB permissions when prompted
  • Enable Developer mode on Android

Network connection fails?

  • Verify printer IP address is correct
  • Check device WiFi connection
  • Try port 9100 (default for ESC/POS printers)

Drawer Not Opening

  • Click "OPEN DRAWER" button (auto-detects all protocols)
  • Check drawer cable is connected to printer (RJ11/RJ12 port)
  • Verify drawer has power
  • Ensure printer is powered ON

Configuration

iOS Performance Settings (config.xml)

<platform name="ios">
    <preference name="WKWebViewOnly" value="true" />
    <preference name="SplashScreenDelay" value="500" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="deployment-target" value="13.0" />
</platform>

Android Settings

<platform name="android">
    <preference name="android-minSdkVersion" value="24" />
    <preference name="android-targetSdkVersion" value="34" />
    <preference name="android-compileSdkVersion" value="34" />
    <preference name="AndroidXEnabled" value="true" />
</platform>

Security

  • Network connections use local HTTP/TCP
  • No data stored or transmitted to external servers
  • USB permissions requested at runtime
  • All communication is local (device ↔ printer)

Dependencies

{
  "cordova-plugin-network-information": "^3.0.0",
  "cordova-plugin-android-permissions": "^1.1.5"
}

NPM Scripts Reference

| Command | Description | |---------|-------------| | npm run clean | Clean build cache and temp files | | npm run setup:android | Setup Android platform (v13) | | npm run setup:ios | Setup iOS platform | | npm run build:android | Build Android APK | | npm run build:ios | Build iOS app | | npm run run:android | Build and run on Android device/emulator | | npm run run:ios | Build and run on iOS device/simulator | | npm run emulator:android | Start Android emulator | | npm run start:android | Start emulator and run app | | npm test | Run unit tests | | npm run test:coverage | Run tests with coverage |

Supported Printers

  • Epson TM series (TM-T88, TM-T20, etc.)
  • Star TSP series (TSP650, TSP700, etc.)
  • Bixolon SRP series
  • Citizen CT series
  • Custom VKP series
  • Any ESC/POS compatible printer

ESC/POS Commands

Standard Command

Hex: 1B 70 00 19 FA
Description: ESC p 0 25 250

Epson Command

Hex: 1B 70 00 32 FA
Description: ESC p 0 50 250

Star Command

Hex: 07
Description: BEL (Bell)

Platform Support

  • iOS: 13.0+ (iPhone, iPad)
  • Android: 7.0+ (API 24+)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Apache-2.0 - See LICENSE file for details

Support

For issues:

  1. Check troubleshooting section above
  2. Verify device and printer compatibility
  3. Test network/USB connection independently
  4. Review console logs in browser dev tools
  5. Open an issue on GitHub

Support the Project

If this project helped you, consider buying me a coffee!

Buy Me A Coffee