@flowget/registry-loader
v0.1.0
Published
Shared registry loader for Flowget — parses REGISTRY_DIR specifiers, resolves npm subpaths and brace expansions, walks the on-disk node/decorator/decider layout, and projects catalog JSON into typed node metadata.
Maintainers
Readme
@flowget/registry-loader
The shared loader for the Flowget REGISTRY_DIR contract. It parses
REGISTRY_DIR specifiers, resolves filesystem paths and npm subpaths,
walks the on-disk node/decorator/decider layout, and projects catalog
JSON into typed node metadata. The worker side imports executors; the
web/builder side reads catalog metadata.
Install
npm i @flowget/registry-loaderUsage
Worker side — walk discovery records and import each executor:
import {
parseRegistryEnv,
expandBraces,
resolveRegistrySpecifier,
discoverRegistry,
} from "@flowget/registry-loader";
const entries = parseRegistryEnv(process.env.REGISTRY_DIR).flatMap(expandBraces);
const paths = entries.map((e) => resolveRegistrySpecifier(e));
const records = await discoverRegistry({ paths });
for (const record of records) {
const mod = await import(record.executorPath);
registerNode(record.name, mod.default);
}Web side — project each <name>.json into typed NodeMetadata:
import { loadCatalogJson } from "@flowget/registry-loader";
const catalog = await Promise.all(
records.map((r) => loadCatalogJson(r.jsonPath)),
);REGISTRY_DIR is a comma-separated list. Each entry is a filesystem
path, an npm package subpath (resolved through the package's exports
field), or a brace expansion (<base>/nodes/{log,delay}). Duplicate
node ids across entries fail loud with a RegistryScanError.
⚠️ 0.x is unstable
The surface is unstable until v1 — breaking changes ship as minor
bumps. Pin exact versions in consumers ("@flowget/registry-loader":
"0.1.0", not "^0.1.0").
Links
- Full documentation: https://docs.flowget.io
- Security policy: SECURITY.md
- License: FSL-1.1-ALv2 (see LICENSE)
