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-client

v0.7.1

Published

EdiabasX client — remote (JSON-RPC) and embedded (in-process) implementations of IEdiabas.

Downloads

565

Readme

@emdzej/ediabasx-client

Remote and in-process implementations of the IEdiabas interface from @emdzej/ediabasx-core. Gives consumers a unified API regardless of whether the EDIABAS runtime is local or on a remote server.

Install

pnpm add @emdzej/ediabasx-client

EdiabasClient (remote)

Connects to an EdiabasServer over TCP or WebSocket. No local SGBD files needed — the server resolves ECU names.

import { EdiabasClient } from "@emdzej/ediabasx-client";

const client = new EdiabasClient({
  host: "192.168.1.50",
  port: 6802,
  transport: "websocket", // or "tcp"
});

await client.init();
const response = await client.job("IKE", "IDENT");

// `response.sets` matches the native EDIABAS C-API shape (see
// @emdzej/ediabasx-ediabas README — "Result-set shape"):
//
//   sets[0]    — system set (VARIANTE, OBJECT, JOBNAME, SAETZE +
//                persistent metadata: ECU, ORIGIN, REVISION, JOB_STATUS, …)
//   sets[1..N] — data sets emitted by the bytecode
for (let i = 1; i < response.sets.length; i++) {
  for (const [name, entry] of Object.entries(response.sets[i])) {
    console.log(`${name}: ${entry.value}`);
  }
}

// Granular accessors mirror the native EDIABAS C API:
//   resultText("VARIANTE", 0, …) reads from the system set
//   resultText(name, 1..N, …)    reads from data sets 1..N
//   resultSets()                 returns the **data**-set count
//                                (== sets.length - 1), matching apiResultSets
console.log(client.resultText("VARIANTE", 0));  // resolved variant name
console.log(client.resultSets());

await client.end();

Each EdiabasResultEntry carries name, type, value, plus optional unit and comment — all five fields propagate through the JSON-RPC wire untouched.

The WebSocket transport uses globalThis.WebSocket (Node 22+ / browsers) — no native dependencies. TCP uses a dynamic import("node:net") so the module stays browser-bundleable when only the WebSocket path is used.

Pre-connected WebSocket (Bimmerz Connect)

Pass a socket option to use a pre-connected WebSocket instead of creating one internally — used for relay-mediated connections via @emdzej/swsrs-client:

import { dial } from "@emdzej/swsrs-client";

const peer = await dial({ relayURL: "wss://connect.bimmerz.app", sessionId, token });
const client = new EdiabasClient({ transport: "websocket", socket: peer.socket });
await client.init();

EmbeddedEdiabas (in-process)

Wraps the Ediabas class behind the same IEdiabas interface. Use this when the cable and SGBD files are local but you want the unified API.

import { EmbeddedEdiabas } from "@emdzej/ediabasx-client";
import { createInterface } from "@emdzej/ediabasx-interfaces";

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

const ediabas = new EmbeddedEdiabas({
  sgbdPath: "/path/to/ecu/files",
  interface: iface,
});

await ediabas.init();
const response = await ediabas.job("IKE", "IDENT");
console.log(ediabas.resultText("VARIANTE", 0));
await ediabas.end();

Binary params (apiJobData)

job(ecu, name, params) covers both the indexed-string channel (apiJobpari / pars opcodes) and the binary channel (apiJobDatapary / parb / parw / parl / parr). The element type carries the channel:

// All string params — semicolon shorthand for indexed slots.
await ediabas.job("KMBI_E60", "STATUS_LESEN", "param1;param2");

// Single binary buffer — apiJobData. Required for binbuf-using SGBDs
// like NCS coding (C_S_LESEN / C_S_SCHREIBEN / C_S_AUFTRAG).
await ediabas.job("KMBI_E60", "C_S_AUFTRAG", new Uint8Array([0x06, 0x10, /*…*/]));

// Mixed — interleave string and binary params in one call.
await ediabas.job("KMBI_E60", "JOB", ["prefix", new Uint8Array([0xDE, 0xAD]), "suffix"]);

Same shape for EdiabasClient — the wire encoding base64s binary entries automatically.

Choosing between them

| | EdiabasClient | EmbeddedEdiabas | |---|---|---| | SGBD files | On the server | Local | | Hardware interface | On the server | Local | | Network round-trip | Yes | No | | Browser-compatible | Yes (WebSocket) | No (node:fs) | | Use case | Remote diagnostics, web UIs | CLI tools, local scripts |

Both implement IEdiabas — swap one for the other without changing calling code.

See also

License

PolyForm Noncommercial 1.0.0.