Skip to content

VZparse

Minimal. Human-readable. Machine-parsable. Schema-validated.

vz
project: "VZparse"
tags: [
  "minimal"
  "readable"
  "schema-validated"
]

# A simple nested object
spec: {
  version: 1
  author: "VZparse Contributors"
}

# Array of objects
examples: [
  { name: "JSON", born: 2001 }
  { name: "YAML", born: 2001 }
  { name: "VZparse", born: 2024 }    
]

# Schema validation
schema: {
  id: "int(min:1,max:1000)!"
  name: "string(minLength:3,maxLength:50)!"
  email: "string(format:email)!"
}

# Template strings
user: {
  name: "Alice"
  role: "admin"
}

greeting: "Hello, ${user.name}! You are a ${user.role}."

notes: |markdown
  # VZparse Features
  This is a **multiline string** with metadata.
  Keeps formatting as-is.
  
  ## Advanced Features
  - Schema validation
  - Template strings
  - Import system
  - Multiline strings with metadata

Rationale ​

JSON is the most popular data-interchange format. But it isn't a very good configuration language.

VZparse keeps JSON's simplicity and adds the needed bits for a modern configuration language:

  1. Comments - Full support for documentation
  2. Multiline strings - Rich text with metadata support
  3. Schema validation - Built-in type checking and constraints
  4. Template strings - Dynamic values with variable interpolation
  5. Import system - Modular configuration with imports
  6. Optional commas - Cleaner syntax
  7. Optional key quotes - Less verbose

VZparse is human-readable, easy to parse, and type-safe.

Features ​

  • Minimal syntax - Simple and intuitive
  • Schema validation - Built-in type checking
  • Template strings - Dynamic values with ${variable} syntax
  • Import system - Modular configuration
  • Multiline strings - Rich text with metadata (|markdown, |json``)
  • Comments - Full documentation support
  • Type-safe - Built-in support for all data types
  • Error handling - Detailed error messages with context

Quick Start ​

bash
npm install vzparse
javascript
import { VZ } from 'vzparse';

const config = VZ.parse(`
  app: {
    name: "MyApp"
    version: "1.0.0"
  }
  
  user: {
    name: "Alice"
    role: "admin"
  }
  
  greeting: "Hello, ${user.name}! You are a ${user.role}."
`, {
  resolveTemplates: true,
  context: { user: { name: 'Alice', role: 'admin' } }
});

console.log(config.greeting); // "Hello, Alice! You are an admin."

Implementations ​

VZparse is actively developed with multiple implementations:

Documentation ​

FAQ ​

  1. What's the difference between VZparse and YAML/JSON?

    • VZparse combines YAML's readability with JSON's simplicity
    • Adds schema validation, template strings, and imports
    • More structured than YAML, more readable than JSON
  2. How does schema validation work?

    • Define schemas inline with type constraints
    • Automatic validation during parsing
    • Detailed error messages with context
  3. Can I use VZparse in production?

    • Yes! VZparse is production-ready
    • Comprehensive test suite
    • TypeScript support
    • Detailed error handling

Released under the MIT License.