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

@emdzej/ediabasx-interfaces

v0.8.0

Published

Factory + JSON-RPC gateway server/client wiring all EdiabasX transports under a single `createInterface(name, opts)` entry point.

Readme

@emdzej/ediabasx-interfaces

Factory and JSON-RPC gateway for all EdiabasX transports. Lets you select an interface by name and a plain options object — useful for config-file-driven setups and for sharing a single physical cable across processes.

Install

pnpm add @emdzej/ediabasx-interfaces

(Pulls in all @emdzej/ediabasx-interface-* packages as dependencies. The @emdzej/j2534-* USB packages are peer deps — auto-installed on pnpm, declare manually on classic npm.)

Factory

import { createInterface, listInterfaces, getInterfaceMetadata } from "@emdzej/ediabasx-interfaces";

const transport = createInterface("kdcan", {
  port: "/dev/cu.usbserial-A50285BI",
  baudRate: 9600,
  protocol: "isotp",
});

// Or discover available interfaces and their options:
for (const meta of listInterfaces()) console.log(meta.name, meta.options);

Supported names: simulation, serial, kdcan, j2534, enet, gateway.

kdcan is a flavour of serial — same SerialInterface class with probeAdapterOnConnect: true so the K+DCAN cable's adapter telegrams (type / version / serial / voltage) are queried on connect. The factory injects NodeSerialTransport in this package; browser consumers construct SerialInterface directly with WebSerialTransport.

j2534 and the j2534-* USB transports are peer dependencies of this package — consumers control the version. pnpm add @emdzej/ediabasx-interfaces will install required peers automatically (pnpm ≥ 7) or warn on classic npm.

JSON-RPC gateway

Share one physical cable across processes / machines. Two transports are supported:

  • websocket (default) — one JSON-RPC message per WebSocket frame, served via http.Server + ws. Works from both Node 22+ (global WebSocket) and browsers — any page can new WebSocket("ws://host:6801").
  • tcp — line-delimited JSON-RPC over a raw TCP socket. Node-only clients; lowest overhead. Set explicitly when you need it.

Both speak the same JSON-RPC 2.0 vocabulary; only the framing differs. Pick one transport per server instance (no multiplexing).

Server (where the cable is)

import { GatewayServer, createInterface } from "@emdzej/ediabasx-interfaces";

const iface = createInterface("kdcan", { port: "/dev/cu.usbserial-A50285BI", baudRate: 9600 });

const server = new GatewayServer({
  port: 6801,
  // transport defaults to "websocket"; set "tcp" for Node-only line-delimited clients.
  interface: iface,
});
await server.start();

Client (anywhere)

import { GatewayClient } from "@emdzej/ediabasx-interfaces";

const transport = new GatewayClient({
  host: "192.168.1.50",
  port: 6801,
  transport: "websocket", // omit for TCP
  // url: "wss://gateway.example.com/ediabasx", // optional, overrides host/port
});
await transport.connect();
// Use `transport` anywhere an EdiabasInterface is expected.

The client uses globalThis.WebSocket (Node 22+ / every browser) so the module stays dep-free for browser bundling. The server uses the ws package because Node has no built-in WebSocket server.

Forwarded methods

The gateway is transparent for the full BEST2 communication surface. In addition to the obvious connect / send / receive, the server delegates these to the backing interface when present:

| JSON-RPC method | Purpose | |---|---| | setParam | Single comm parameter (P1, P2, CAN IDs, …) | | setCommParameter | Bulk parameter array (the BEST2 xsetpar opcode — falls back to a setParam loop if the backend only has the singular setter) | | setAnswerLength | One-shot answer length hint | | setRepeatCounter | Repeat counter for retried jobs | | transmitData | DS2 / synchronous request-response | | rawData | Adapter-level raw byte exchange | | getPort / setPort | Hardware port access | | getIgnitionVoltage / getBatteryVoltage / getLoopTest | Cable diagnostics | | setProgramVoltage, switchSiRelais | EPROM / programming pins |

CLI

# Server side — TCP (default)
ediabasx gateway --interface kdcan --serial-port /dev/cu.usbserial-A50285BI --serial-baud 9600

# Server side — WebSocket
ediabasx gateway --transport websocket --interface kdcan --serial-port /dev/cu.usbserial-A50285BI

# Client side — TCP
ediabasx run file.prg IDENT --interface gateway --gateway-host 192.168.1.50 --gateway-port 6801

# Client side — WebSocket
ediabasx run file.prg IDENT --interface gateway \
  --gateway-host 192.168.1.50 --gateway-port 6801 \
  --gateway-transport websocket

# Client side — explicit URL (for wss:// or path-based deployments)
ediabasx run file.prg IDENT --interface gateway --gateway-url wss://gateway.example.com/ediabasx

On startup the server prints the backend interface it's bound to, so it's easy to confirm which cable a remote gateway is serving:

Backend interface: KDCAN · /dev/cu.usbserial-A50285BI @ 115200
Gateway server listening on 127.0.0.1:6801 (transport=websocket)

License

PolyForm Noncommercial 1.0.0.