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-text-tables

v0.8.0

Published

Parsers for NCSEXPER DATEN text tables (SGFAM, ZST, AT, AT.M00, AT.ZUS). Spec: ../../docs/daten-format.md §2

Readme

@emdzej/ncsx-text-tables

Parsers for the text-format companion files NCSEXPER ships alongside its binary DATEN files under C:\NCSEXPER\DATEN\<BR>\. These are all line-oriented, ISO-8859-1, with their own legacy syntax conventions (semicolon-prefixed data rows, positional whitespace columns, etc.).

Spec: ../../docs/daten-format.md §2.

Files parsed

| File | Parser | Purpose | |-----------------------|-------------------|------------------------------------------------------------| | <BR>SGFAM.DAT | parseSgfam | Logical SG short-name → (CABD, SGBD, ZCS-flag, FA-flag) | | <BR>AT.000 | parseAt | FA-token dictionary: type-letter + code + FSW list | | <BR>AT.M00 | parseAtM00 | Compact M-list (Z / E / W / S category records) | | <BR>AT.ZUS | parseAtZus | AT companion (same lexical form, mostly change log) | | <BR>ZST.000 | parseZst | SA-bit / ASW-bit / FA-bit master with masks + FSW keywords |

Install

pnpm add @emdzej/ncsx-text-tables
# or:
"@emdzej/ncsx-text-tables": "workspace:*"

Encoding matters. These files are Latin-1, not UTF-8. Decode accordingly:

const raw = readFileSync(path, 'latin1');

Quick start

import { readFileSync } from 'node:fs';
import {
  parseSgfam,
  parseAt,
  parseAtM00,
  parseZst,
} from '@emdzej/ncsx-text-tables';

const root = '/Users/me/NCSEXPER/DATEN/e46';

const sgfam = parseSgfam(readFileSync(`${root}/E46SGFAM.DAT`, 'latin1'));
console.log(sgfam.rows.find((r) => r.sgName === 'EWS'));
// { sgName: 'EWS', cabd: 'A_EWS3', sgbd: 'C_EWS3', zcsFlag: …, faFlag: … }

const at = parseAt(readFileSync(`${root}/E46AT.000`, 'latin1'));
const w502 = at.records.find((r) => r.category === 'W' && r.code === '502');
console.log(w502?.fsws);   // ['SWA', …] — FSWs implied by FA code 502

const zst = parseZst(readFileSync(`${root}/E46ZST.000`, 'latin1'));
console.log(zst.records.filter((r) => r.fsw === 'DAUERTON').length);

API

| Export | Returns | |-----------------------|-----------------------------------------------| | parseSgfam(text) | SgfamFile { rows: SgfamRow[] } | | parseAt(text) | AtFile { records: AtRecord[] } | | parseAtM00(text) | AtM00File { entries: AtM00Entry[] } | | parseAtZus(text) | Same shape as parseAt | | parseZst(text) | ZstFile { header, records, unparsed } | | iterLines(text) | Low-level line iterator (handles comments) | | tokens(line) | Whitespace-tokenise a row line |

Key concepts

SGFAM — the SG family table

Per-SG declaration:

  • sgName — logical short name like EWS, KMB, LSZ_E46
  • cabd — coding-bundle DATEN file name to load (e.g. A_EWS3 → opens A_EWS3.C07)
  • sgbd — EDIABAS SGBD file the cable speaks (e.g. C_EWS3)
  • zcsFlag / faFlag — whether this SG participates in ZCS / FA scopes

AT — FA token dictionary

Each record is (category, code, fsws[]):

  • category — one of W (Werks-/order option), Z (Zwang/forced), E (Entfall/excluded), S (Sonderfall/special)
  • code — 4-digit short code, e.g. 0205
  • fsws[] — function-keyword names this FA code implies (used by fa-asw to build the ASW bit set)

AT.M00 — compact M-list

A variant of AT used for chassis-wide forced-inclusion rules. parseAtM00 exposes the same (category, code, fsws[]) shape.

ZST — the master SA/FA/FSW table

The grand reference for SA/VN/FA-code ↔ ASW-bit-mask + FA-bit-mask + FSW keyword. Notably, the file format uses lines that start with ; to look like comments to legacy editors, but the parser knows to treat them as data when they match the right shape.

Related