Skip to content

Syntax Reference

Let’s dive in!

Keep your configs documented with single-line comments:

// This is a comment
name = João // Inline comment
age = 20

Pro Tip: Use comments to explain why a configuration exists, not just what it is.

The heart of JSSON: simple key-value pairs without the quote ceremony.

name = João
age = 20
height = 1.75
admin = true

When to use quotes:

  • Use quotes when your value contains spaces: title = "Software Engineer"
  • Skip quotes for simple identifiers: name = João

JSSON supports all JSON data types with a cleaner syntax:

// Strings (with or without quotes)
name = João
title = "Software Engineer"
// Numbers (integers and floats)
age = 25
price = 19.99
// Booleans
active = true
disabled = false

Nested objects are clean and intuitive — perfect for configuration files:

user {
name = João
age = 20
admin = true
config {
theme = dark
notifications = true
}
}

Use Case: Perfect for app configs, server settings, and any hierarchical data.

Mix any types freely — no quotes needed for simple values:

numbers = [ 1, 2, 3, 4, 5 ]
colors = [ red, blue, green ]
mixed = [ João, 25, true, 1.75 ]

Power move: The map clause lets you transform each row. Add prefixes, compute values, or inject default fields — all in one place!

Compute values instead of hardcoding them:

price = 100
tax = 15
total = price + tax
discount = 20
final = total - discount
quantity = 5
itemPrice = 10
subtotal = quantity * itemPrice

Supported operators:

  • Arithmetic: +, -, *, /, % (modulo)
  • Grouping: ( ) for precedence

Use Case: Perfect for configs where values depend on each other — no need to manually calculate!

Access object properties using dot notation:

config {
host = localhost
port = 5432
}
connectionString = config.host + ":" + config.port

Pro Tip: Combine member access with expressions to build dynamic values from existing config!

JSSON supports powerful conditional logic with comparison operators and ternary expressions.

Compare values to get boolean results:

age = 20
isAdult = age >= 18 // true
canRentCar = age >= 25 // false
isTeenager = age >= 13
hasDiscount = age < 12

Supported operators: ==, !=, >, <, >=, <=

Choose between two values based on a condition:

status = age >= 18 ? "adult" : "minor"
access = role == "admin" ? "full" : "limited"

You can even nest them for complex logic:

salary = level == "senior" ? 120000 :
level == "mid" ? 80000 :
50000

Split large configurations across multiple files for better organization:

database {
host = "localhost"
port = 5432
}

Organization: Split by concern (database.jsson, api.jsson). Use main file to include others.

Expressions: Great for derived values. Reduces errors, makes configs self-documenting.

Ranges: Perfect for sequential data. Use step for custom increments.

KeywordDescription
templateDefines the structure for array items
mapTransforms template data with custom logic
includeImports another JSSON file
stepDefines the increment in ranges
true / falseBoolean values
OperatorDescription
=Assignment
+Addition / Concatenation
-Subtraction
*Multiplication
/Division
%Modulo (remainder)
== !=Equality / Inequality
> <Greater / Less than
>= <=Greater/Less than or equal
? :Ternary conditional
..Range operator
.Member access