
Security News
Cloudflare Introduces a Faster TypeScript Compiler Written in Rust
Cloudflare introduces tsrs, a Rust port of TypeScript’s compiler promising faster checks and lower memory use, with the TypeScript team’s help.
@zenbase/llml
Advanced tools
Lightweight Language Markup Language - Convert nested data structures to human-readable, XML-like markup
The most elegant way to generate structured text in TypeScript/JavaScript.
LLML transforms your data into beautifully formatted XML-like markup with zero fuss and maximum flexibility. Perfect for prompt engineering, configuration generation, and structured document creation.
import { llml } from './src';
// Simple values
console.log(llml({ greeting: "Hello World" }));
// Output: <greeting>Hello World</greeting>
// Lists become numbered items
console.log(llml({ tasks: ["Buy milk", "Walk dog", "Code LLML"] }));
// Output:
// <tasks-list>
// <tasks-1>Buy milk</tasks-1>
// <tasks-2>Walk dog</tasks-2>
// <tasks-3>Code LLML</tasks-3>
// </tasks-list>
// Complex nested structures
console.log(llml({
title: "My Project",
features: ["Fast", "Simple", "Powerful"],
config: { debug: true, version: "1.0" }
}));
dedent for multiline handling# Using bun (recommended)
bun install
# Using npm
npm install
# Using yarn
yarn install
// Add prefix to all keys
console.log(llml({ message: "Hello" }, { prefix: "app" }));
// Output: <app-message>Hello</app-message>
const instructions = `
Step 1: Install LLML
Step 2: Import llml
Step 3: Create magic
`;
console.log(llml({ instructions }));
// Output:
// <instructions>
// Step 1: Install LLML
// Step 2: Import llml
// Step 3: Create magic
// </instructions>
const promptData = {
system: "You are a helpful assistant",
rules: [
"Be concise and clear",
"Provide examples when helpful",
"Ask clarifying questions"
],
context: {
userLevel: "beginner",
topic: "TypeScript programming"
}
};
console.log(llml(promptData));
Perfect for structuring complex prompts:
const prompt = llml({
role: "Senior TypeScript Developer",
task: "Code review the following function",
criteria: ["Performance", "Readability", "Best practices"],
code: functionToReview
});
Generate clean config files:
const config = llml({
database: { host: "localhost", port: 5432 },
features: ["logging", "caching", "monitoring"],
environment: "production"
});
Create structured documents:
const document = llml({
title: "API Documentation",
sections: ["Authentication", "Endpoints", "Examples"],
metadata: { version: "2.1", author: "Dev Team" }
});
Run the comprehensive test suite:
# Run tests once
bun test
# Run tests in watch mode
bun test:watch
# Run with coverage
bun test --coverage
The test suite covers:
LLML TypeScript supports:
# Clone the repo
git clone https://github.com/yourusername/llml.git
cd llml/ts
# Install dependencies
bun install
# Run tests
bun test
# Run tests in watch mode
bun test:watch
# Type checking
bun run tsc --noEmit
llml(data, options?)Parameters:
data: any - The data to convert to markupoptions?: LLMLOptions - Optional configurationOptions:
interface LLMLOptions {
indent?: string; // Custom indentation string (default: "")
prefix?: string; // Prefix for all keys (default: "")
}
Returns: string - The formatted markup
Examples:
// Simple usage
llml({ name: "John" })
// → <name>John</name>
// With options
llml({ name: "John" }, { prefix: "user", indent: " " })
// → <user-name>John</user-name>
// Complex data
llml({
users: [
{ name: "Alice", age: 30 },
{ name: "Bob", age: 25 }
]
})
// → <users-list>
// <users-1>
// <users-1-name>Alice</users-1-name>
// <users-1-age>30</users-1-age>
// </users-1>
// <users-2>
// <users-2-name>Bob</users-2-name>
// <users-2-age>25</users-2-age>
// </users-2>
// </users-list>
We love contributions! Whether it's:
Check out our contribution guidelines to get started.
MIT License - see LICENSE file for details.
If LLML makes your life easier, give us a star! ⭐
Made with ❤️ for the TypeScript community
LLML: Because beautiful markup shouldn't be hard.
FAQs
Lightweight Language Markup Language - Convert nested data structures to human-readable, XML-like markup
The npm package @zenbase/llml receives a total of 213 weekly downloads. As such, @zenbase/llml popularity was classified as not popular.
We found that @zenbase/llml demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare introduces tsrs, a Rust port of TypeScript’s compiler promising faster checks and lower memory use, with the TypeScript team’s help.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.