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/ncsx-daten

v0.8.0

Published

Parser for BMW NCSEXPER DATEN binary-frame files (BR_REF.DAT, *SGET.000, *SGVT.000, *.Cxx, etc.). Spec: ../../docs/daten-format.md

Readme

@emdzej/ncsx-daten

Parser for BMW NCSEXPER DATEN binary-frame files — the format every chassis-table, SG-coding, and lookup file under C:\NCSEXPER\DATEN\ is encoded in.

This is the foundational package in the ncsx stack: every higher-level package (chassis, cabd, function-list, options, …) takes a parsed DatenFile as input.

Full format spec: ../../docs/daten-format.md. Concrete delta vs. the original bimmerz/packages/ncs-data POC: ../../docs/POC-DELTAS.md.

File types this parses

| File pattern | What it is | |----------------------------|---------------------------------------------------------------| | BR_REF.DAT | Chassis index — list of supported chassis + aliases | | <BR>DST.000 | Per-chassis dataset overview (e.g. E46DST.000) | | <BR>SGET.000 | SG-list selectors with SGAUSWAHL_* and AUFTRAGSAUSDRUCK | | <BR>SGVT.000 | SG variants | | <BR>ZCSUT.000 | ZCS update tables | | <BR>CVT.000 | Coding variants (per-FSW order-option predicates) | | <SGBD>.Cxx | Per-SG CABD coding rules (PARZUWEISUNG_FSW + PSWs etc.) | | SWT<KIND><NN>.DAT | Keyword↔KEYID lookup tables (ASW/FSW/PSW) | | <BR>AUSBL.H00, *.K00 | Auxiliary binary tables |

Install

pnpm add @emdzej/ncsx-daten
# or, in the ncsx monorepo:
"@emdzej/ncsx-daten": "workspace:*"

Quick start

import { readFileSync } from 'node:fs';
import { parseDatenFile } from '@emdzej/ncsx-daten';

const buf = readFileSync('NCSEXPER/DATEN/BR_REF.DAT');
const file = parseDatenFile(buf);

for (const block of file.blocks) {
  console.log(`block 0x${block.id.toString(16)} ${block.name}`);
  for (const row of block.rows) {
    console.log('  ', row);
  }
}

Frame format (one-page primer)

struct frame {
  uint8_t  size;                 // payload length in bytes
  uint16_t type;                 // u16 little-endian
  uint8_t  payload[size];
  uint8_t  crc;                  // XOR-fold of [size, type_lo, type_hi, payload]
};

| Frame type | Meaning | |------------|--------------------------------------------------------| | 0x0100 | Signature 1 | | 0x0200 | Signature 2 | | 0x0300 | Block definition — id + name | | 0x0400 | Block definition — format string | | 0x0500 | Block definition — field names (comma-separated) | | 0xFF00 | Divider — end of definitions, start of data | | any other | Data row for the block whose id matches the frame type |

Format-string mini-language: scalars B (u8) W (u16 LE) L (u32 LE) S (ASCII+NUL) A (length-prefixed raw bytes), with modifiers {X} (optional u8 presence), (X) (u16-count collection), X(X) (non-empty list), XX(XX) (range list).

API

| Export | Purpose | |-------------------------|----------------------------------------------------------------| | parseDatenFile(buf) | Two-pass parse: definitions then data rows | | parseFormatString(s) | Just the format-string mini-language | | readScalar(type, …) | Read one scalar value from a payload | | readRow(fields, payload) | Read one row's worth of values | | xorFoldCrc(bytes) | The DATEN per-frame CRC (XOR-fold of header + payload) |

DatenFile shape

interface DatenFile {
  signatures: { type: number; payload: Uint8Array }[];
  blocks: Block[];
  /** All data rows in document order — same row objects as `block.rows`. */
  rowsInOrder: OrderedRow[];
}

interface Block {
  id: number;
  name: string;       // e.g. "PARZUWEISUNG_FSW"
  fields: FieldDef[]; // declared columns
  rows: RowValues[];  // one entry per data frame for this block
}

rowsInOrder exists because some consumers (function-list, options) need cross-block adjacency — e.g. PARZUWEISUNG_PSW1 always follows its parent PARZUWEISUNG_FSW in the binary, and that ordering is lost if you only walk block.rows.

Options

parseDatenFile(buf, {
  strictCrc: false,        // default true — when false, mismatched frames are skipped
  onWarning: (msg) => { … }, // CRC mismatch, malformed format string, unknown frame type
});

Related