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

@capvision/pos

v1.0.4

Published

TypeScript library to communicate with **payment terminals (EPT / POS)** that speak the **CaisseAP / Concert V3 (v3.20)** protocol, over **serial/USB** or **TCP/IP**.

Downloads

67

Readme

@capvision/pos

TypeScript library to communicate with payment terminals (EPT / POS) that speak the CaisseAP / Concert V3 (v3.20) protocol, over serial/USB or TCP/IP.

It abstracts the link-layer protocol (handshake, framing, LRC, retries, multi-frame responses) and the business frames (payment, refund, cancellation), so the host application only deals with simple submit* calls and a typed response.

Features

  • 🔌 Serial/USB and TCP/IP transports.
  • 🧭 Fully configurable serial link (baud, data bits, parity, stop bits, flow control, DTR/RTS) plus auto-detection across a library of known configurations to support the widest range of terminals.
  • 🧱 Layered, testable architecture: business socket → protocol codec → byte transport. Add custom media via a transportFactory.
  • 🛑 Cancellation (AbortSignal), per-stage timeouts, NAK resend, EOT link-release on abort, and an optional pre-transaction watchdog.
  • 🔒 PCI-aware logging: card data (PAN, CMC7 track) is masked.
  • 116 hardware-free tests (Vitest) covering the protocol, framing, responses and auto-detection.

Install

npm install @capvision/pos

Node ≥ 22. The serial transport needs the serialport peer dependency (^13); TCP/IP uses Node's built-in net.

Quick start

import { POSSocket_Serial, POSSocket_TCPIP } from "@capvision/pos";

// Serial / USB (default 9600 8N1)
const pos = new POSSocket_Serial("COM3");
// Auto-detect the serial configuration:
// const pos = new POSSocket_Serial("COM3", { autoDetect: true });
// Or TCP/IP:
// const pos = new POSSocket_TCPIP("192.168.1.50", 8888);

await pos.openConnection();
try {
    const res = await pos.submitPayment(10.5); // €10.50
    if (res.success) console.log("Accepted", res.amount, res.paymentMethod);
    else if (res.canceled) console.log("Cancelled");
    else console.log("Refused:", res.reason);
} finally {
    await pos.closeConnection();
}

Operations: submitPayment(amount), submitRefund(amount), submitCancellation(amount). Amounts are in monetary units (e.g. 10.5 = €10.50) and must be strictly positive. All accept an optional { signal: AbortSignal }.

Documentation

  • 📖 docs/GUIDE.md — full developer guide: architecture, serial compatibility & auto-detection, TCP/IP, cancellation/timeouts, custom transports, error handling, security.
  • 📐 docs/feature.md — protocol/functional reference (for re-implementation in another language).
  • 🛠️ docs/README.md — build & npm publishing (Azure Pipelines).

Scripts

| Script | Description | |---|---| | npm run build | Build the library into dist/ (tsup). | | npm test | Run the Vitest suite (no hardware required). | | npm run test:watch | Vitest in watch mode. | | npm run test:coverage | Vitest with coverage. | | npm run test:integration | Interactive harness in tool/ (real terminal). | | npm run check | Biome format + lint (--write). |

License

Proprietary — © Cap Vision (capvision.fr). All rights reserved.