LEAN Format

Lightweight Efficient Adaptive Notation

A minimal, human-readable data format that combines JSON's flexibility with CSV's compactness

70%Smaller than JSON
5minTo learn
100%Compatible
# Clean, readable syntax
users(id, name, email):
  - 1, "Alice", "alice@example.com"
  - 2, "Bob", "bob@example.com"

config:
  theme: "dark"
  features:
    - "auth"
    - "api"

Compact

Row syntax eliminates key repetition in lists, making your data up to 70% smaller than JSON for tabular content.

👁️

Readable

Natural indentation and minimal syntax make LEAN easy to read and write by humans.

🔄

Flexible

Seamlessly mix objects, lists, and row syntax. Use the best representation for each data type.

🎯

Simple

Learn the entire format in 5 minutes. No complex rules or edge cases to remember.

See the Difference

Compare how LEAN represents the same data versus JSON:

LEAN - 126 chars
# 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
JSON - 284 chars
{
  "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
    }
  ]
}
🎯55% more efficient

Complex Nested Structures

LEAN handles nested objects beautifully:

LEAN
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: true

Format Comparison

See how LEAN compares to other popular formats

FeatureJSONYAMLCSVLEAN
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

Quick Start

Get started with LEAN in minutes

1. Installation

npm install lean-format

2. Node.js Usage

const { 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);

3. Try It Live

Experiment with LEAN in our interactive playground:

🎮 Open Playground

Documentation

Everything you need to master LEAN

📖

Specification

Complete format specification with grammar and rules, including syntax, data types, and best practices.

Read Spec
💻

API Reference

Documentation for parse(), format(), and validate() functions with all available options.

View API
🎮

Playground

Try LEAN format interactively in your browser with real-time conversion and examples.

Open Playground