Registry / web-framework / 0x-lang

0x-lang

JSON →
library0.1.29jsnpmunverified

0x (v0.1.29) is an experimental AI-first programming language and compiler that transpiles a concise DSL into full-stack production code for React, Vue 3, Svelte 5, Express, React Native, and Terraform. It significantly reduces boilerplate — a component written in 18 lines of 0x typically generates ~96 lines of TypeScript React. The compiler is distributed as a CLI tool via npm, supports watch mode and project scaffolding, and ships with TypeScript types. Active development, monthly releases. Differentiators: multi-target compilation from a single source, built-in DSL for UI, state, and backend logic, and LSP/IDE support.

npm install 0x-lang
INSTALL
IMPORT
SIG · 0X-LANG
0
0x-lang
web-frameworkjavascriptv0.1.29
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

0x CLI
npm install -g 0x-lang
npm install 0x-lang (local install requires npx or global)
The package is primarily a CLI tool. Install globally for '0x' command, or use npx 0x-lang for one-off runs.
default export (programmatic use)
import compile from '0x-lang'
const { compile } = require('0x-lang')
Programmatic API is ESM-only starting v0.1.0; CJS require works only for default export.
build command (watch mode)
0x dev counter.ai --target react
0x watch counter.ai (no such command)
Use 'dev' subcommand for watch/recompile mode.

Installs the 0x-lang CLI globally, creates a minimal 0x source file with a stateful page component, and compiles it to a React component.

npm install -g 0x-lang cat > hello.ai << 'EOF' page Hello: state name: str = "World" layout col gap=16 padding=24 center: text "Hello, {name}!" size=3xl bold input name placeholder="Your name" EOF 0x build hello.ai --target react
0x --version
Debug
Known issues
breakingVersion 0.1.0 changed output format from JSON to source files. Older versions' `0x build --format json` no longer works.
fix
Upgrade to >=0.1.0 and use `0x build` (defaults to source files). For JSON output, pipe through a custom formatter.
affects: <0.1.0
breakingRequires Node.js >=18; fails silently on Node 16 with obscure errors.
fix
Update Node.js to 18+ using nvm or your package manager.
affects: <18
deprecatedThe `--format` flag (`--format react`, `--format vue`) is deprecated as of v0.1.0. Use `--target react` instead.
fix
Replace `--format` with `--target` in CLI commands. Example: `0x build app.ai --target react`.
affects: >=0.1.0,<0.2.0
gotchaGenerated React components use React 18's createRoot; not compatible with React 17 automatically.
fix
Ensure your project uses React 18+. If stuck on React 17, compile with `--target react-17`? No such option — fork or avoid.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module '0x-lang'
Package installed locally but not globally.
fix
Run `npm install -g 0x-lang` or use `npx 0x-lang build ...`.
TypeError: compile is not a function
Using require('0x-lang') which returns the default export as an object with compile property? Actually default export is a function. Wrong import style.
fix
Use `import compile from '0x-lang'` (ESM) or `const compile = require('0x-lang').default` (CJS).
error: unknown option `--target'
Using older version <0.1.0 that used --format instead.
fix
Upgrade to >=0.1.0 or use `--format` if on older version: `0x build app.ai --format react`.
Upgrade
Version history
0.1.29latest on npm
Audit
Dependencies
typescriptoptionalcompiler output targets TypeScript; types required for generated code
Agent activity
82 hits · last 30 days
node
72
OpenAI (training)
1
Resources
0x-lang — npm install 0x-lang · libregistry