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

@itxtech/fdnext-decodepack

v2.3.0

Published

Default iTXTech fdnext DecodePack rules and compiler

Readme

@itxtech/fdnext-decodepack

Default iTXTech fdnext DecodePack rules and compiler — the data-driven rule engine for part number and typed identifier decoding.

Overview

@itxtech/fdnext-decodepack provides the complete DecodePack rule ecosystem for fdnext:

  • JSON Rule Packs — Vendor-specific part number (PN) and NAND Flash ID decoding rules expressed as structured JSON.
  • CompilercompileDecodePack() transforms JSON specs into executable decoders consumable by @itxtech/fdnext-core.
  • DiagnosticscheckDecodePack() validates rule consistency; explainPartDecode() / explainIdentifierDecode() produce step-by-step decode traces.
  • Default PackdefaultDecodePack bundles all built-in vendor rules for immediate use.

Rule Architecture

Rules are organized as JSON packs under src/rules/packs/ (PN rules) and src/identifier/packs/ (identifier rules). Each pack targets a specific vendor and product line (e.g. samsung-ufs-token.json, skhynix-emcp-token.json).

A PartDecodeSpec defines:

  • Match — Prefix or regex pattern to select the decoder.
  • Normalize — Input preprocessing (trim, uppercase, remove characters).
  • Token Decoder — Structured token parsing via steps (take, map, takeLongest, tpl, fallback, mul, etc.) and assign for output mapping.
  • Shared Tables — Cross-rule lookup tables (density, die profile, package codes, etc.).

Installation

pnpm add @itxtech/fdnext-decodepack

Quick Start

import { compileDecodePack, defaultDecodePack } from "@itxtech/fdnext-decodepack";

// Compile the default rule pack
const compiled = compileDecodePack(defaultDecodePack);

// Use with @itxtech/fdnext-core
import { createEngine } from "@itxtech/fdnext-core";
const engine = createEngine({
  decoders: compiled.partDecoders,
  identifierDecoders: compiled.identifierDecoders
});

Diagnostics

import { checkDecodePack, explainPartDecode, defaultDecodePack } from "@itxtech/fdnext-decodepack";

// Validate rule pack consistency
const check = checkDecodePack(defaultDecodePack);

// Step-by-step decode trace
const explanation = explainPartDecode(defaultDecodePack, "BWCA2KZC-64G");

Exports

| Export | Description | | :--- | :--- | | defaultDecodePack | Pre-assembled DecodePack with all built-in vendor rules | | compileDecodePack(pack) | Compile a DecodePack into executable part and identifier decoders | | checkDecodePack(pack) | Validate rule consistency and report issues | | explainPartDecode(pack, pn, opts?) | Produce a step-by-step decode trace for a part number | | explainIdentifierDecode(pack, id, opts?) | Produce a step-by-step decode trace for a typed identifier | | defaultPartDecodeSpecs | Raw array of all built-in PN decode specs | | defaultIdentifierDecodeSpecs | Raw array of all built-in identifier decode specs |

Directory Structure

src/
├── compiler.ts              # DecodePack → executable decoder compiler
├── default-decodepack.ts    # Default pack assembly
├── types.ts                 # DecodePack type definitions
├── nand-die-profile.ts      # NAND die profile helpers
├── rules/
│   ├── default-rules.ts     # PN rule registry
│   ├── packs/               # Vendor JSON rule packs (PN)
│   └── tables/              # Shared lookup tables
└── identifier/
    ├── default-rules.ts     # Identifier rule registry
    └── packs/               # Vendor JSON rule packs (Flash ID)

Testing

pnpm -C packages/decodepack test
pnpm -C packages/decodepack typecheck

Documentation

License

AGPL-3.0-or-later — See LICENSE for details.