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

v2.3.0

Published

Platform-neutral fdnext HTTP and operation dispatch runtime

Readme

@itxtech/fdnext-runtime

Platform-neutral HTTP and operation dispatch runtime for fdnext.

Overview

@itxtech/fdnext-runtime is the shared runtime layer that sits between the core engine and platform-specific adapters (Hapi, Cloudflare Workers, Aliyun FC). It provides:

  • Unified Dispatch — A single dispatch() API for all fdnext operations (part.decode, part.search, identifier.decode, identifier.search, capabilities, index).
  • HTTP Route Resolution — Maps HTTP GET/HEAD requests to fdnext operations with parameter parsing (query, lang, limit, controllerGroup, constraints, idScheme).
  • External Link Provider — Pluggable system for attaching platform-specific external links to decode/search results via the links contract.
  • CORS Management — Configurable CORS handling with wildcard and multi-origin support, driven by FDNEXT_CORS_ORIGINS environment variable.
  • Web Fetch API — A fetch() method compatible with the standard Web Fetch API for Cloudflare Workers and similar environments.

Architecture

Platform Adapters (Hapi / CF Workers / Aliyun FC)
        │
        ▼
  @itxtech/fdnext-runtime   ← HTTP routing, dispatch, CORS, External Links
        │
        ▼
  @itxtech/fdnext-core       ← Engine, decoders, result building

All adapters delegate to the same runtime instance, ensuring consistent routing and response behavior across platforms.

Installation

pnpm add @itxtech/fdnext-runtime

Quick Start

import { createFdnextRuntime } from "@itxtech/fdnext-runtime";

const runtime = createFdnextRuntime();

// Dispatch an operation programmatically
const response = await runtime.dispatch({
  operation: "part.decode",
  input: { query: "MT29F64G08CBABA", lang: "eng" }
});

// Handle a raw HTTP request
const httpResponse = await runtime.handleHttp({
  method: "GET",
  url: "/parts/decode?query=MT29F64G08CBABA&lang=eng",
  headers: {}
});

// Use as a Web Fetch handler (Cloudflare Workers style)
const fetchResponse = await runtime.fetch(new Request("https://example.com/parts/decode?query=MT29F64G08CBABA"));

External Link Provider

const runtime = createFdnextRuntime({
  externalLinkProviders: [{
    id: "docs",
    resolveLinks(ctx) {
      if (ctx.facts.vendor === "micron") {
        return [{
          id: "micron.home",
          label: "Micron",
          url: "https://www.micron.com/",
          category: "vendor",
          priority: 10
        }];
      }
      return [];
    }
  }]
});

HTTP Routes

| Path | Operation | Description | | :--- | :--- | :--- | | / | index | Health check — server name and fdnext version | | /capabilities | capabilities | Engine capabilities, resource inventory, decoder list | | /parts/decode | part.decode | Decode a single part number | | /parts/search | part.search | Search part numbers | | /identifiers/decode | identifier.decode | Decode a typed identifier | | /identifiers/search | identifier.search | Search typed identifiers |

Exports

| Export | Description | | :--- | :--- | | createFdnextRuntime(options?) | Create a runtime instance with engine, dispatch, HTTP handler, and fetch | | parseFdnextCorsOrigins(value) | Parse CORS origins from string or array | | createFdnextCorsOptionsFromEnv(env) | Read CORS config from environment variables | | FDNEXT_CORS_ORIGINS_ENV | Environment variable name constant |

Documentation

License

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