Skip to content

Multi-Format Transpilation

JSSON is a universal meta-format. This means you can write your configuration logic once in JSSON and output it to whatever format your tools require.

FormatCLI FlagBest For
JSONDefaultAPIs, Web Configs, Data Interchange
YAML-f yamlKubernetes, CI/CD, CloudFormation
TOML-f tomlRust Configs, Python (pyproject.toml), Hugo
TypeScript-f tsFrontend Constants, Design Systems, Shared Types

The JSSON compiler takes your source code, evaluates all logic (templates, maps, ranges, expressions), and then serializes the resulting data structure into the target format.

Consider this JSSON file defining a server configuration:

server.jsson
server {
host = "localhost"
port = 8080
// Dynamic environment
env = production
// Computed timeout
timeout = 30 * 1000
features = [ logging, metrics, tracing ]
}

Standard JSON output.

{
"server": {
"host": "localhost",
"port": 8080,
"env": "production",
"timeout": 30000,
"features": [
"logging",
"metrics",
"tracing"
]
}
}

The TypeScript transpiler is particularly powerful because it bridges the gap between your configuration and your application code.

  1. as const Assertions: All objects are generated with as const, making them immutable and narrowing types to their literal values.
  2. Type Inference: JSSON automatically exports a TypeScript type for each top-level object (e.g., export type Server = typeof server).
  3. Zero Runtime: The output is pure TypeScript/JavaScript. No JSSON runtime is needed in your application.

You can define your design tokens in JSSON and generate typed TypeScript constants for your frontend:

tokens.jsson
colors {
primary = "#0070f3"
secondary = "#ff4081"
gray [
template { shade, value }
map (item) = {
shade = item.shade * 100
value = "#" + item.shade + item.shade + item.shade
}
1..9
]
}

Generates:

export const colors = {
primary: "#0070f3",
secondary: "#ff4081",
gray: [
{ shade: 100, value: "#111" },
{ shade: 200, value: "#222" },
// ...
],
} as const;
export type Colors = typeof colors;

Now you have full autocompletion for your design tokens in your React/Vue/Svelte components!