Lightweight Efficient Adaptive Notation
A minimal, human-readable data format that combines JSON's flexibility with CSV's compactness
# Clean, readable syntax
users(id, name, email):
- 1, "Alice", "alice@example.com"
- 2, "Bob", "bob@example.com"
config:
theme: "dark"
features:
- "auth"
- "api"Row syntax eliminates key repetition in lists, making your data up to 70% smaller than JSON for tabular content.
Natural indentation and minimal syntax make LEAN easy to read and write by humans.
Seamlessly mix objects, lists, and row syntax. Use the best representation for each data type.
Learn the entire format in 5 minutes. No complex rules or edge cases to remember.
Compare how LEAN represents the same data versus JSON:
# Compact and readable
users(id, name, email, age):
- 1, "Alice", "alice@example.com", 30
- 2, "Bob", "bob@example.com", 25
- 3, "Casey", "casey@example.com", 28{
"users": [
{
"id": 1,
"name": "Alice",
"email": "alice@example.com",
"age": 30
},
{
"id": 2,
"name": "Bob",
"email": "bob@example.com",
"age": 25
},
{
"id": 3,
"name": "Casey",
"email": "casey@example.com",
"age": 28
}
]
}LEAN handles nested objects beautifully:
blog:
title: "Tech Insights"
author: "Alice"
tags:
- "technology"
- "programming"
- "ai"
posts(id, title, date, views):
- 1, "Getting Started", "2025-01-15", 1250
- 2, "Advanced Topics", "2025-02-01", 890
config:
theme: "dark"
comments: trueSee how LEAN compares to other popular formats
| Feature | JSON | YAML | CSV | LEAN |
|---|---|---|---|---|
| Human-readable | ⚠️ Verbose | ✓ Excellent | ⚠️ Limited | ✓ Excellent |
| Compact rows | ✗ No | ✗ No | ✓ Yes | ✓ Yes |
| Nested objects | ✓ Yes | ✓ Yes | ✗ No | ✓ Yes |
| No key repetition | ✗ No | ✗ No | ✓ Yes | ✓ Yes |
| Comments | ✗ No | ✓ Yes | ✗ No | ✓ Yes |
| Easy to parse | ✓ Easy | ⚠️ Complex | ✓ Easy | ✓ Easy |
Get started with LEAN in minutes
npm install lean-formatconst { parse, format } = require('lean-format');
// Parse LEAN to JavaScript
const data = parse(`
users(id, name, age):
- 1, Alice, 30
- 2, Bob, 25
`);
// Format JavaScript as LEAN
const lean = format(data);
console.log(lean);Everything you need to master LEAN
Complete format specification with grammar and rules, including syntax, data types, and best practices.
Read SpecDocumentation for parse(), format(), and validate() functions with all available options.
View APITry LEAN format interactively in your browser with real-time conversion and examples.
Open Playground