High-performance data transformation stack for JSON, YAML, TOML, INI, CSV, XML, MessagePack, and TOON.
🏆 415x faster YAML | 9x faster TOML | 2-3x faster INI | 30-60% LLM token savings
| Package | Status | Performance | Features |
|---|---|---|---|
| @sylphx/molt-json | ✅ Stable | 1.7-2.5x faster | Dirty JSON, Type preservation, Streaming, Validation |
| @sylphx/molt-yaml | ✅ Stable | 2-415x faster 🔥 | Anchors, Multi-doc, Full YAML 1.2 |
| @sylphx/molt-toml | ✅ Stable | 2-9x faster ⚡ | Nested tables, Arrays, Type-safe |
| @sylphx/molt-ini | ✅ Stable | 2-3x faster | Git config, PHP config, Windows INI |
| @sylphx/molt-csv | ✅ Stable | 1.4-7.6x faster | Type conversion, WASM, Streaming |
| @sylphx/molt-xml | ✅ Stable | Matches fastest | Dirty XML cleaning ⭐ |
| Package | Status | Performance | Features |
|---|---|---|---|
| @sylphx/molt-msgpack | ✅ Stable | Competitive | Binary format, 20-50% smaller than JSON |
| @sylphx/molt-toon | ✅ Stable | 30-60% token savings 🤖 | LLM-optimized, Table format, Minimal quoting |
| Package | Status | Features |
|---|---|---|
| @sylphx/molt | ✅ Stable | All formats in one package |
# Install individual packages
bun add @sylphx/molt-json
bun add @sylphx/molt-yaml
bun add @sylphx/molt-toml
bun add @sylphx/molt-ini
bun add @sylphx/molt-csv
bun add @sylphx/molt-xml
bun add @sylphx/molt-msgpack
bun add @sylphx/molt-toon
# Or install all at once
bun add @sylphx/moltimport { molt } from '@sylphx/molt-json'
const data = molt(`{
user: 'alice', // ✅ Unquoted keys
joined: new Date(), // ✅ Date preserved
id: 123n, // ✅ BigInt preserved
}`)import { molt } from '@sylphx/molt-yaml'
const config = molt(`
app: MyApp
database:
host: localhost
port: 5432
`)import { molt } from '@sylphx/molt-toml'
const config = molt(`
[database]
host = "localhost"
port = 5432
`)import { parseCSV } from '@sylphx/molt-csv'
const data = parseCSV('name,age,active\nAlice,30,true', {
parseTypes: true // Auto-detect types
})import { molt } from '@sylphx/molt-xml'
// Handles dirty XML automatically
const data = molt('<user name=alice age=30/>', {
cleanDirty: true
})import { molt } from '@sylphx/molt-ini'
const config = molt(`
[database]
host = localhost
port = 5432
`)
console.log(config.database.port) // 5432import { encode, decode } from '@sylphx/molt-msgpack'
const data = { user: 'alice', id: 123 }
const binary = encode(data) // 20-50% smaller than JSON
const restored = decode(binary)import { stringify } from '@sylphx/molt-toon'
const data = {
users: [
{ id: 1, name: 'Alice', age: 30 },
{ id: 2, name: 'Bob', age: 25 }
]
}
// 30-60% fewer tokens for LLM prompts!
const toon = stringify(data)
// users:
// id | name | age
// 1 | Alice | 30
// 2 | Bob | 25See BENCHMARKS.md for complete results.
| Format | Best Performance | vs Competitor |
|---|---|---|
| YAML | 415x faster 🔥 | vs yaml (multi-doc) |
| TOML | 9x faster ⚡ | vs @iarna/toml (nested) |
| INI | 2-3x faster ⚡ | vs ini (npm) |
| JSON | 2.5x faster ⚡ | vs superjson (serialize) |
| CSV | 7.6x faster 🚀 | vs papaparse (quoted) |
| XML | Matches fastest | vs fast-xml-parser |
| MessagePack | Competitive | vs @msgpack/msgpack |
| TOON | 30-60% token savings 🤖 | vs JSON for LLMs |
Key Advantages:
- 🥇 Fastest YAML parser in the ecosystem
- 🥇 Fastest TOML parser available
- 🥇 First high-performance TOON implementation
- 🥈 Top-tier JSON serialization performance
- 🥈 Competitive CSV with WASM acceleration
- 🥈 XML performance with unique dirty-cleaning
- 🥈 MessagePack with full type support
- ⚡ Blazing Fast - Up to 415x faster than alternatives
- 🛡️ Type Safety - Full TypeScript support with strict types
- 🔧 Dirty Input - Handle malformed JSON/XML automatically
- 🦀 WASM Acceleration - Rust-powered for performance-critical paths
- 📦 Zero Dependencies - Minimal bundle size
- 🔄 Streaming API - Process large files efficiently
- Dirty JSON parsing (unquoted keys, trailing commas, comments)
- Type preservation (Date, BigInt, Map, Set, RegExp, etc.)
- Schema validation (Zod, JSON Schema)
- Streaming for large files
- Full YAML 1.2 spec support
- Anchors and aliases
- Multi-document parsing
- Custom tags
- 2-415x faster than competitors
- Tables and nested tables
- Array of tables
- Inline tables
- Type-safe parsing
- 2-9x faster than alternatives
- Section support ([section])
- Comment support (; and #)
- Type coercion (numbers, booleans)
- Git/PHP/Windows INI compatible
- 2-3x faster than alternatives
- Automatic type detection
- Custom delimiters
- Header handling
- WASM acceleration
- Streaming support
- DOM and object conversion
- CDATA support
- Namespace handling
- Dirty XML cleaning (unique!)
- Matches fastest parsers
- Full MessagePack spec support
- Binary data handling
- Date/timestamp encoding
- BigInt support
- 20-50% smaller than JSON
- 30-60% token savings for LLMs
- Table format for uniform arrays
- Minimal quoting
- YAML-style indentation
- Perfect for ChatGPT/Claude/GPT-4 prompts
molt/
├── packages/
│ ├── json/ # JSON transformer
│ ├── yaml/ # YAML parser/serializer
│ ├── toml/ # TOML parser/serializer
│ ├── csv/ # CSV parser/serializer
│ ├── xml/ # XML parser/serializer
│ └── molt/ # Meta package
├── docs/ # VitePress documentation
├── .github/ # CI/CD workflows
├── .changeset/ # Changesets for versioning
├── turbo.json # Turborepo configuration
└── BENCHMARKS.md # Performance benchmarks
# Clone the repository
git clone https://github.com/sylphx/molt.git
cd molt
# Install dependencies
bun install
# Build all packages (with Turbo cache)
turbo build
# Run tests for all packages
turbo test
# Run benchmarks
turbo bench
# Lint and format
bun lint
bun format# Create a changeset (for versioning)
bunx changeset
# Version packages
bunx changeset version
# Publish to npm
bunx changeset publish# Start docs dev server
cd docs
bun dev
# Build docs
bun docs:build
# Preview built docs
bun docs:preview- 📖 Full Documentation (coming soon)
- 📊 Benchmarks
- 🔧 API Reference
- 📦 Package Guides
- Runtime: Bun - Ultra-fast JavaScript runtime
- Language: TypeScript with strict mode
- Monorepo: Turborepo - High-performance build system
- Versioning: Changesets - Version management
- Testing: Vitest - Fast unit testing
- Benchmarking: Vitest benchmark mode
- Bundling: tsup - TypeScript bundler
- Linting: Biome - Fast linter and formatter
- Docs: VitePress - Documentation site
- Acceleration: Rust + WASM for performance-critical paths
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes with tests
- Run tests:
turbo test - Create a changeset:
bunx changeset - Lint:
bun lint:fix - Commit:
git commit -m "feat(json): add awesome feature" - Push and create a Pull Request
See CONTRIBUTING.md for detailed guidelines.
MIT © Sylphx
Each package in this monorepo is licensed under the MIT License.
Built with inspiration from:
- dirty-json - Original dirty JSON parser
- superjson - Type-preserving JSON
- js-yaml - YAML parser
- fast-xml-parser - XML parser
- papaparse - CSV parser
Made faster, more powerful, and production-ready by Sylphx.
If you find Molt useful, please consider giving it a star ⭐