Datapad
@theholocron/datapad finds a <name>.config.* file, loads it (JSON, JS, TS, ESM or CJS), layers a dedicated file over a key of a parent file, deep-merges, and hands back a plain object. TypeScript configs load through tsx with no build step.
It is Holocron-agnostic: no schema, no validation, no defaults. Consumers build those on top:
@theholocron/cliforholocron.config.*@theholocron/astromechforastromech.config.*@theholocron/sentinelfor configs fetched from GitHub rather than read from disk
Installation
Section titled “Installation”pnpm add @theholocron/datapadimport { loadConfigFile, loadLayered, mergeConfig, createDefineConfig } from "@theholocron/datapad";
// One file: holocron.config.{ts,js,mjs,cjs,json}const found = await loadConfigFile<MyConfig>({ cwd, name: "holocron" });// { config, filepath } | null
// A dedicated file layered over the `tasks` key of a parent fileconst layered = await loadLayered<TasksConfig>({ cwd, name: "astromech", fallback: { file: "holocron", key: "tasks" },});// { config, filepath, sources } | null (the dedicated file wins on conflict)
const merged = mergeConfig(defaults, layered?.config);
// A typed identity defineConfig for one config shapeexport const defineConfig = createDefineConfig<TasksConfig>();“Not found” is null, never an error. A file that exists but is unusable throws ConfigFileError, carrying its filepath.
The loaders probe .ts, .js, .mjs, .cjs, then .json.
Related
Section titled “Related”- Configuration: the config the CLI builds on top of datapad
- Source and the full API notes:
cli/datapadon GitHub
The full API reference is generated from the package’s TSDoc comments.