@dayangac/fkld
v0.2.0
Published
FKLD (Flexible Kirigami List Datastructure) — a JSON file format extending FOLD for kirigami architecture design. Format core: spec/KEYS registry, cut subtypes, edge-molecule params, IO.
Maintainers
Readme
FKLD
FKLD, the Flexible Kirigami List Datastructure, is a JSON data model and
CoffeeScript library for adding kirigami- and architecture-specific metadata on
top of the FOLD file format. Every FKLD file
is a valid FOLD 1.2 file with extra keys under the reserved fkld: namespace,
so FOLD-aware tools render the crease pattern and ignore the extensions.
Install
npm install @dayangac/fkldShips as an ES module with TypeScript declarations.
Usage
// Flat barrel — everything is re-exported by name:
import { KEYS, validateEdgeCutTypes, validateMoleculeArrays,
serializeFkld, parseFkld } from "@dayangac/fkld";
KEYS.edges.cutType; // "fkld:edges_cutType" (nested registry = source of truth)
validateEdgeCutTypes(asgn, ct) // -> { ok, errors }
serializeFkld(file) // -> JSON text (trailing newline)
// Or per-module via subpath:
import * as spec from "@dayangac/fkld/spec";
import * as cuts from "@dayangac/fkld/cut-types";
import * as mol from "@dayangac/fkld/molecule";
import * as io from "@dayangac/fkld/io";Format core (0.2.0)
| Module | Exports |
| --- | --- |
| spec | NAMESPACE, nested KEYS, KEY_LIST, isRegisteredKey, isFkldKey, deepFreeze |
| cut-types | CUT_TYPES, CUT_TYPE_INFO, isCutType, validateEdgeCutTypes |
| molecule | MOLECULE_FIELDS, pack/unpackEdgeMolecules, isValid*, validateMoleculeArrays |
| io | serializeFkld, parseFkld |
0.2.0 re-baseline. This version aligns the published library with the design the Kirigamizer app uses: a nested
KEYSregistry and array-oriented validators. The earlier 0.1.x file-oriented modules (cuts/molecules/curvature/ materials/architecture/filter and the vendored FOLD layer) are preserved underlegacy-0.1/and may return in a future release. App-specific glue (the AKDE FoldNet → FKLD bridge) intentionally lives in the app, not this package.
Develop
npm run build # coffee -> lib/ (ESM) + copy .d.ts
npm test # smoke test against the built package