Quick Start
Get a self-documenting pipeline running in 3 steps.
Install
Section titled “Install”npm install footprintjs pnpm add footprintjs yarn add footprintjs 1. Define your state
Section titled “1. Define your state”interface OrderState { orderId: string; total: number; status?: string;}2. Build your flowchart
Section titled “2. Build your flowchart”import { flowChart } from 'footprintjs';
const chart = flowChart<OrderState>('ValidateOrder', async (scope) => { scope.status = scope.total > 0 ? 'valid' : 'invalid';}, 'validate') .addFunction('ProcessPayment', async (scope) => { scope.status = 'paid'; }, 'process') .build();3. Run and observe
Section titled “3. Run and observe”import { narrative } from 'footprintjs';
const rec = narrative();await chart.recorder(rec).run({ input: { orderId: 'ORD-001', total: 49.99 } });
console.log(rec.lines().join('\n'));// Stage 1: The process began with ValidateOrder.// Step 1: Write status = "valid"// Stage 2: Next, it moved on to ProcessPayment.// Step 1: Write status = "paid"Next steps
Section titled “Next steps”- Key Concepts — understand scope, recorders, and the observer pattern
- Building a flowchart — all builder methods explained
- Interactive Playground — run examples live