DEV Community

Cover image for JSSON (JavaScript Simplied Object Notation)
Carlos Eduardo Git
Carlos Eduardo Git

Posted on

JSSON (JavaScript Simplied Object Notation)

Today I'm officially launching JSSON (pronounced “djéisson”, write that down)

First things first: this is NOT trying to replace JSON.
The goal is simple: save you from the pain of writing JSON by hand.

I know, I know… I can already hear someone sighing:

“Oh boy, here comes another TOON-like format…”

Relax. I promise this is not the kind of format that makes you regret becoming a developer.


🤔 Why does JSSON exist?

Think about all those times you had to manually craft:

  • giant mocks
  • database seeds
  • repetitive structures
  • endless configs
  • massive arrays

…and then spent 30 minutes fighting commas, quotes, brackets, indentation, and a mild headache.

Yeah.
JSSON exists to end that suffering.


The most basic example

user {
  name = João
  age = 20
  admin = true
  roles = [ "admin", "editor" ]
  config {
    theme = dark
  }
}
Enter fullscreen mode Exit fullscreen mode

No quotes on simple values.
No commas.
No drama.


Simple template (yes, it looks like CSV… calm down)

users [
  template { name, age, job, height }
  João, 19, Student, 1.75
  Maria, 25, Teacher, 1.65
  Pedro, 30, Doctor, 1.80
  Ana, 22, Nurse, 1.68
]
Enter fullscreen mode Exit fullscreen mode

Yep, it resembles CSV.
And no, this alone won’t generate huge structures.

But breathe, and keep reading:

Templates + logic.

This is where JSSON starts changing your mind.


Okay, now: logic baked into the format

This example transforms every item automatically:

routes [
  template { path, method }

  map (item) = {
    path = "/api/" + item.path
    method = item.method
  }

  users, GET
  posts, POST
]
Enter fullscreen mode Exit fullscreen mode

Output:

{
  "routes": [
    { "path": "/api/users", "method": "GET" },
    { "path": "/api/posts", "method": "POST" }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Generating huge structures with ranges

servers [
  template { id, port }

  map (s) = {
    id = s.id
    ip = "192.168.1." + s.id
    port = s.port
  }

  100..120,
  3000..3020
]
Enter fullscreen mode Exit fullscreen mode

Yes, this generates 21 servers with matching IPs and ports.
Yes, without writing anything manually.
Yes, cue the victory theme.


Giving your data “intelligence”

users [
  template { name, age, department, yearsOfService }

  map (u) = {
    name = u.name
    age = u.age
    department = u.department
    yearsOfService = u.yearsOfService

    canVote = u.age >= 18
    isExecutive = u.yearsOfService >= 10
    accessLevel = u.yearsOfService >= 10 ? "senior"
                : u.yearsOfService >= 5  ? "mid"
                : "junior"
    salary = u.yearsOfService >= 10 ? 150000
            : u.yearsOfService >= 5 ? 100000
            : 60000
    benefits = u.yearsOfService >= 5 ? ["health", "dental", "401k"] : ["health"]
  }

  "João Silva", 35, Engineering, 12
  "Maria Santos", 28, Sales, 6
  "Pedro Costa", 22, Marketing, 2
]
Enter fullscreen mode Exit fullscreen mode

You write a few lines and follow a pattern.
JSSON builds an entire smart object structure for you.


Generating dozens of users in minutes

users [
  template { id, department }

  map (u) = {
    id = u.id
    username = "user_" + u.id
    email = "user_" + u.id + "@company.com"
    dept = u.department
    role = "employee"
  }

  // Engineering
  100..104, Engineering

  // Sales
  200..204, Sales
]
Enter fullscreen mode Exit fullscreen mode

Done. Automatically generated users, all neatly standardized.


Generating entire teams (logic + ranges)

The classic example:

employees [
  template { id, dept, level }

  map (e) = {
    id = e.id
    name = "Employee " + e.id
    email = "emp" + e.id + "@corp.com"
    department = e.dept
    level = e.level
    salary = e.level == "senior" ? 120000 
           : e.level == "mid"    ? 80000 
           : 50000
  }

  // Engineering
  1000..1004, Engineering, junior
  1005..1009, Engineering, mid
  1010..1012, Engineering, senior

  // Sales
  2000..2009, Sales, junior
  2010..2014, Sales, mid

  // HR
  3000..3002, HR, mid
  3003..3004, HR, senior
]
Enter fullscreen mode Exit fullscreen mode

This is extremely useful for:

  • seeds
  • unit tests
  • prototyping
  • fake APIs
  • demos
  • internal scripts

Now THIS: Modularization with include

Yep — JSSON can include other .jsson files and merge them.

include "database.jsson"
Enter fullscreen mode Exit fullscreen mode

How it works:

  • resolves path
  • detects cycles (A includes B, B includes A → error)
  • caching
  • transpiles the included file
  • merges into the root (with keep, overwrite, or error mode)

Example:

database.jsson

db { host = localhost }
Enter fullscreen mode Exit fullscreen mode

main.jsson

app = "MyApp"
include "database.jsson"
Enter fullscreen mode Exit fullscreen mode

JSON output:

{
  "app": "MyApp",
  "db": { "host": "localhost" }
}
Enter fullscreen mode Exit fullscreen mode

Simple. Direct. Done.


Full JSSON feature list 😏

Basic Syntax

  • No quotes for simple values
  • No commas
  • // comments
  • Strings, numbers, booleans, arrays, objects

Template Arrays

users [
  template { name, age }
  João, 25
  Maria, 30
]
Enter fullscreen mode Exit fullscreen mode

Map (transformation)

map (user) = {
  name = user.name
  active = true
}
Enter fullscreen mode Exit fullscreen mode

Powerful Ranges

  • 1..10
  • 10..1
  • 0..10 step 2
  • "192.168.1.100".."192.168.1.150"

Expressions

  • + - * / %
  • Comparisons
  • Ternary
  • Concatenation
  • Member access
  • Precedence with ()

Modularization via Include

  • Merge modes: keep, overwrite, error
  • Cycle detection
  • Include caching

Extras

  • Zero-padding ranges (emp001..emp010)
  • Mixed-type arrays
  • Unlimited nested objects
  • Variables inside map

CLI

  • -i input
  • -o output
  • --merge-mode

Quick comparison

Format Logic Support Ranges Templates Modularization Purpose
JSON Data
YAML Config
CSV ✔️ (partial) Tables
JSSON ✔️ ✔️ ✔️ ✔️ Data generation

Want to try it? Documentation & tools

Documentation (still polishing sitemap, indexing soon):
👉 https://jsson-docs.vercel.app

I’m working on the online playground this week, but for now you can try the current CLI build (tested on Windows):

How to use it right now (super quick)

  1. Download the CLI (tested on Windows, use version 0.0.2): https://github.com/CarlosEduJs/jsson/releases
  2. Run in terminal: jsson -i input.jsson -o output.json
  3. Done: instant JSON.

Full docs:
👉 https://jsson-docs.vercel.app

VS Code Syntax Highlighting extension:
👉 https://marketplace.visualstudio.com/items?itemName=carlosedujs.jsson


That’s it — you now know everything about JSSON.

Thanks for reading! 🙌

Top comments (0)