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

rdhiq-cr

v0.0.1

Published

TypeScript/JavaScript client for the RDHIQ card reader **local agent HTTP API**. It targets dual ESM + CommonJS builds with matching type declarations.

Readme

rdhiq-cr

TypeScript/JavaScript client for the RDHIQ card reader local agent HTTP API. It targets dual ESM + CommonJS builds with matching type declarations.

The HTTP client uses the global fetch. Consumers can run on Node 18+, Bun, or other runtimes that provide fetch.

Install

npm install rdhiq-cr
# or
bun add rdhiq-cr

To use the repo directly before publish, link or depend on the git URL for this repository.

Quick start

By default the client talks to http://127.0.0.1:5078. Override with baseUrl if your agent listens elsewhere.

import { RdhiqClient, ApiError } from 'rdhiq-cr';

const client = new RdhiqClient({
  // baseUrl: 'http://127.0.0.1:5078', // default
});

// Health
await client.health.get();

// Session + read job
const { sessionId } = await client.sessions.open(null);
const { jobId } = await client.reads.create(sessionId, null);
const job = await client.reads.get(sessionId, jobId);
const text = await client.reads.getText(sessionId, jobId);

reads.getImage returns an ArrayBuffer (binary).

Non-success HTTP statuses throw ApiError with status and body (see below).

API overview

RdhiqClient exposes five namespaces:

| Property | Role | | ---------- | ----------------------------------------------------------- | | health | GET /health | | admin | Agent settings and logs under /api/v1/admin/* | | reader | Initialize reader, scanner info, notifications, latest read | | sessions | Open, get, release, heartbeat | | reads | Create read jobs, poll status, text, image, cancel |

For every method, path, and exported type, see the API reference or the guide.

Errors

Failed responses (response.ok === false) throw ApiError:

  • status — HTTP status code
  • body — parsed JSON if possible, otherwise plain text
  • name'ApiError'
import { ApiError } from 'rdhiq-cr';

try {
  await client.health.get();
} catch (e) {
  if (e instanceof ApiError) {
    console.error(e.status, e.body);
  }
  throw e;
}

Exports

The package exports RdhiqClient, ApiError, RdhiqClientOptions, and request/response types (for example SessionOpenResponse, ReadJobResponse). See src/index.ts.

Documentation

Site source lives in docs/. Run bun run docs:dev to work on it locally. Markdown sources: guide, API.

Developing this package

Requirements: Bun 1.3+ for scripts in this repo.

bun install
bun test
bun run build

Scripts

| Script | What it does | | ---------------------- | ---------------------------------------------------------- | | bun run build | Clean dist/, then build ESM, CJS, and types in sequence | | bun run build:clean | Remove the dist/ directory | | bun run build:esm | Emit dist/index.mjs (+ source map) | | bun run build:cjs | Emit dist/index.cjs (+ source map) | | bun run build:types | Emit dist/index.d.mts and dist/index.d.cts via tsc | | bun test | Run the test suite | | bun run fmt | Format with oxfmt | | bun run lint | Lint and auto-fix with oxlint | | bun run docs:dev | Run the VitePress dev server | | bun run docs:build | Build the static docs site | | bun run docs:preview | Preview the built docs site | | bun run release | Run release-it |

Project layout

src/
  index.ts             Public exports
  client.ts            RdhiqClient
  http.ts              HttpClient (JSON + binary)
  error.ts             ApiError
  types.ts             API types
  resources/
    admin.ts
    health.ts
    reader.ts
    reads.ts
    sessions.ts
test/
  index.test.ts
tsconfig.json
tsconfig.build.json
docs/                  VitePress site

Build output

bun run build writes dist/index.{mjs,cjs} plus index.d.mts / index.d.cts. Publishing uses "files": ["dist"] and conditional exports with nested types for ESM and CJS.

Git hooks

husky runs:

  • pre-commit: lint-staged (see .lintstagedrc.json)
  • commit-msg: commitlint using @commitlint/config-conventional