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

v0.2.1

Published

BEST2 virtual machine: registers, flags, stacks, 184 opcodes, result sets — a TypeScript port of EdiabasLib`s C# core.

Downloads

860

Readme

@emdzej/ediabasx-interpreter

BEST2 virtual machine — a TypeScript port of EdiabasLib's C# core, used by EdiabasX to actually execute BMW PRG/GRP bytecode.

Install

pnpm add @emdzej/ediabasx-interpreter @emdzej/ediabasx-best-parser

What it implements

  • Register file: B0–BF / A0–AF (8-bit, 32 regs), I0–IF (16-bit), L0–L7 (32-bit), S0–SF (string), F0–F7 (double-precision float)
  • Flags: Z, C, V, S — with per-opcode update rules matching C# OpCode handlers (incl. the strcmp Z-inversion, pop's flag refresh, …)
  • Call stack and data stack with the exact push/pop byte ordering EdiabasLib uses
  • 184 opcodes dispatched from a single table — arithmetic, control flow, string, float, communication (x*), result emission (erg*), parameters (par*), tables, file I/O, timers, shared memory, error traps
  • Result sets: enewset commits the current collector into an archive and starts a new one. execute() returns JobResult[][] — one entry per emitted set, with the trailing pending set auto-committed (mirrors C# ExecuteJobPrivate)
  • Trap bits and eerr for structured error handling

Usage

import { parsePrg } from "@emdzej/ediabasx-best-parser";
import { Interpreter } from "@emdzej/ediabasx-interpreter";
import { readFile } from "node:fs/promises";

const buffer = new Uint8Array(await readFile("./MS430DS0.prg"));
const prg = parsePrg(buffer);

const interpreter = new Interpreter(prg);
const sets = await interpreter.execute("FS_LESEN", {
  // optional: parameters, communicationInterface, tableState, …
});

// Multi-record jobs (FS_LESEN: N fault entries) return N+ sets, each
// with the same field names (F_ORT_NR, F_ORT_TEXT, …).
for (const [i, set] of sets.entries()) {
  console.log(`Set ${i + 1}/${sets.length}`);
  for (const r of set) console.log(`  ${r.name} (${r.type}) = ${r.value}`);
}

Communication interface

xsend / xrecv / xsetpar / etc. need a transport. You can build one yourself by implementing the CommunicationInterface shape, or use a ready-made one from @emdzej/ediabasx-interface-serial, @emdzej/ediabasx-interface-enet, or @emdzej/ediabasx-interface-base (simulation).

Tracing

Set EDIABASX_VERBOSE=1 to emit per-op traces for xsend, tabseek, tabget, and strcmp to stderr — invaluable when debugging which branch a real-ECU run took.

License

PolyForm Noncommercial 1.0.0.