Conceptual Walkthrough First Principles
json-transformer:
from source-driven traversal to structural evolution and leaf function execution.
Why Start Here?
Most documentation begins with complex enterprise configurations, directives, and real-world Tally XML schemas. This walkthrough takes the opposite approach: it starts with fundamental JavaScript problems and builds the entire architecture step-by-step from zero.
By following these 6 short, incremental documents, you will develop an intuitive mental model of why
json-transformer works the way it does, and why the engine code never changes even as your
data models scale.
The 6-Document Road Map
The core invariant: The source is traversed, the instructions are consulted. The engine never traverses the recipe.
The minimal working example: traversing a 2-node source (customer, order) and attaching behavior at runtime.
Adding a third root node (product). Demonstrating that data structure can grow while the traversal engine remains completely unchanged.
Recursive nesting: adding child nodes (customer.email, product.code) without adding any special-case algorithms.
Large source data with sparse instructions. Why instructions only touch targeted nodes and omit unneeded data.
Deep-dive on the leaf function signature: value (What?), path (Where?), source (Context?), and instruction (Why?).