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-best-parser

v0.2.1

Published

Parser and disassembler for BMW EDIABAS PRG/GRP (BEST2) files.

Readme

@emdzej/ediabasx-best-parser

Parser and disassembler for BMW EDIABAS PRG/GRP files (the BEST2 binary diagnostic format). Part of the EdiabasX monorepo.

Install

pnpm add @emdzej/ediabasx-best-parser

What it does

  • Decodes the XOR-encoded payload (key 0xF7) and validates the @EDIABAS OBJECT header
  • Extracts the job list (with name, args, results, comment metadata)
  • Extracts lookup tables (column names + cell values)
  • Reads ECU metadata (origin, revision, author, package, language)
  • Disassembles BEST2 bytecode into readable assembly bounded by next-job offsets, so multi-eoj jobs (early-return paths followed by tail code reached via backward jumps) decode in full

Usage

import {
  parsePrg,
  disassembleJob,
  formatInstruction,
} from "@emdzej/ediabasx-best-parser";
import { readFile } from "node:fs/promises";

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

console.log(prg.metadata.ecu, prg.metadata.revision);
console.log(`${prg.jobs.length} jobs, ${prg.tables.length} tables`);

// Disassemble a single job, bounded by the next job's offset so multi-eoj
// jobs (e.g. FS_LESEN's fault loop) decode completely.
const job = prg.binaryJobs.find((j) => j.name === "FS_LESEN");
const nextJobOffset = /* sort binaryJobs by offset and pick the next */;
const instructions = disassembleJob(buffer, job.offset, { endOffset: nextJobOffset });

for (const instr of instructions) {
  console.log(formatInstruction(instr, { color: false }));
}

API surface

parsePrg(buffer: Uint8Array): PrgFile

disassembleJob(buffer: Uint8Array, jobOffset: number, options?: {
  endOffset?: number;       // bound decoding by the next job's file offset
  maxInstructions?: number; // safety cap (defaults to 100_000)
}): Instruction[]

disassemble(code: Uint8Array): Instruction[]               // legacy: decoded bytes already
formatInstruction(instr: Instruction, options?: DisassemblyOptions): string
formatInstructions(instructions: Instruction[], options?: DisassemblyOptions, header?: string): string[]

File format

  • Magic header @EDIABAS OBJECT\0 (16 bytes)
  • 0x10: file type (0 = GRP, 1 = PRG)
  • 0x18: SSIZE (max string register size)
  • Offsets at 0x7C / 0x80 / 0x84 / 0x88 / 0x90 / 0x94 point at uses / job code / tables / job list / descriptions / version info
  • Everything past 0xA0 is XOR-encoded with key 0xF7

The parser handles decryption transparently.

License

PolyForm Noncommercial 1.0.0.