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

v0.8.0

Published

AUFTRAGSAUSDRUCK byte-coded predicate evaluator. Spec: ../../docs/ecu-selection.md §6

Downloads

831

Readme

@emdzej/ncsx-predicate

Evaluator for the byte-coded AUFTRAGSAUSDRUCK predicate language used in NCSEXPER's <BR>SGET.000 SGAUSWAHL_* rows and <BR>CVT.000 order-options. These predicates encode "does this row apply to my car's FA?" in a compact byte language.

Spec: ../../docs/ecu-selection.md §6.

What it does

Takes a byte-coded predicate (a Uint8Array) and an ASW bit set (a Set<number> of u16 SA IDs derived from the car's FA — see @emdzej/ncsx-fa-asw). Returns true if the predicate's boolean expression evaluates to true under that ASW.

The grammar, after S<id-lo><id-hi> tokens are resolved to 0/1 based on whether the ASW has the matching bit set:

expr     = and_term (',' and_term)*    ; OR
and_term = atom    ('+' atom)*          ; AND
atom     = '0' | '1' | '!'? '(' expr ')'

Install

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

Quick start

import { evalAuftragsausdruck } from '@emdzej/ncsx-predicate';

// `(SA_902 + SA_903) , SA_905` — "(902 AND 903) OR 905"
const predicate = new Uint8Array([
  0x28,                   // (
    0x53, 0x86, 0x03,      //   S 0x0386
    0x2b,                  //   +  (AND)
    0x53, 0x87, 0x03,      //   S 0x0387
  0x29,                   // )
  0x2c,                   // ,  (OR)
  0x53, 0x89, 0x03,       // S 0x0389
]);

evalAuftragsausdruck(predicate, new Set([0x0389])); // → true
evalAuftragsausdruck(predicate, new Set([0x0386])); // → false (need 0x0387 too)

API

| Export | Purpose | |---------------------------------|------------------------------------------------------| | evalAuftragsausdruck(bytes, asw, opts?) | Top-level: evaluate a predicate to boolean | | lexAuftragsausdruck(bytes, asw, opts?) | Lex-and-substitute: returns a flat "0+(1,…)" string | | evalExpression(flat) | Pure-string evaluator (mostly internal) | | extractReferencedIds(bytes) | Find every S<id> reference (for static analysis) | | PredicateError | Thrown on malformed bytes |

Operators

| Byte | Symbol | Meaning | |------|--------|--------------------------------------------------------| | 0x53 | S | Reference an SA ID: S<lo><hi> → looks up u16 in ASW | | 0x28 / 0x29 | ( ) | Grouping | | 0x21 | ! | NOT (applies to the next atom) | | 0x2b | + | AND | | 0x2c | , | OR | | 0x30 | 0 | Literal false | | 0x31 | 1 | Literal true |

When to reach for it

  • You're walking SGAUSWAHL_* rows from <BR>SGET.000 and need to know which apply. (@emdzej/ncsx-ecu-select already does this for you.)
  • You're walking a CVT DATEN file and need to filter PSWs by the user's FA. (@emdzej/ncsx-options extracts these predicates per (FSW, PSW); then feed them through this evaluator.)
  • You want to know what SA codes a row references without evaluating it (extractReferencedIds).

Empty predicates

A zero-length Uint8Array evaluates to true — that's NCSEXPER's convention for "no constraint, applies to all FAs". Worth knowing because most order-options rows you'll see in real DATEN are empty.

Related