Skip to content

FlatType.jsFlatten API JSON. Get typed models.

Compact key-value text that is about half the size of JSON on list payloads, cheaper in LLM prompts, and maps straight to typed models in every frontend framework.

ts
import { encode } from "@flattype/core";

encode({ page: 1, users: [{ id: 1, name: "Alice", address: { city: "Paris" } }, { id: 2, name: "Bob", address: { city: "Delhi" } }] });
// page: 1
// users[2]{id,name,address.city}:
//   1, Alice, Paris
//   2, Bob, Delhi

Released under the MIT License.