DON (Directive Object Notation) is a simple and expressive data serialization format, designed for configuration files, infrastructure as code, and structured documents. Modern alternative to JSON and YAML.
Minimalist syntax with support for primitive types, nested blocks, and multi-line content. Write configurations that are easy to read and maintain.
name "my-application"
version "1.0.0"
port 8080
enabled true
server {
host "example.com"
port 443
route /api/* {
handler "apiHandler"
timeout 30
}
}
template <<<HTML
<!DOCTYPE html>
<html>
<body>
<h1>Welcome</h1>
</body>
</html> A directive is a named instruction with optional arguments. It is the fundamental element of DON.
directive_name [arg1] [arg2] ... [argN]
name "my-app"
- Directiva con argumento string
port 8080
- Directiva con argumento numérico
enabled true
- Directiva con argumento booleano
name "my-application"
version "1.0.0"
port 8080
enabled true # Keywords (Identificadores)
environment production
mode development
# Strings
name "my-application"
path 'C:\Users\file.txt'
# Números
port 8080
timeout 30.5
maxSize 1024n
hex 0xDEADB
octal 0o755
binary 0b1101
# Booleanos
enabled true
deprecated false
# Null
value null Directive arguments can be of different primitive types, allowing values to be expressed naturally and readably.
Simplified strings without quotes for greater simplicity. Must start with a letter or underscore, can contain letters, numbers, and underscores.
Text delimited by single or double quotes. Supports escape sequences.
Integers, decimals, BigInt (suffix 'n'), hexadecimal (0x), octal (0o), and binary (0b). Supports negative values.
Logical values true or false (case-sensitive).
Represents absence of value with the null keyword.
Directives can contain subdirectives using blocks delimited by braces, allowing you to create complex hierarchical structures.
Group related directives into logical blocks, improving code readability and maintainability.
You can nest blocks to any depth, allowing you to model complex data structures.
Braces {} clearly define the start and end of each block, with no ambiguity in parsing.
server {
host "example.com"
port 443
route /api/* {
handler "apiHandler"
timeout 30
middleware {
auth true
cors {
origin "*"
methods "GET, POST"
}
}
}
route /static/* {
handler "staticHandler"
cache true
}
} template <<<HTML
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<h1>Welcome</h1>
</body>
</html>
script <<<BASH
#!/bin/bash
echo "Deploying..."
npm run build
query <<<SQL
SELECT * FROM users
WHERE status = "active"
ORDER BY created_at DESC Heredocs allow you to include multi-line content with a custom delimiter, ideal for templates, scripts, and embedded documents.
directive <<<DELIMITER
content line 1
content line 2 Define your own delimiter (HTML, SQL, BASH, etc.) to identify the content type.
Maintains indentation and line breaks from the original content, perfect for embedded code.
No need to escape quotes or special characters inside the heredoc.