Getting Started

LokaScript is a complete hyperscript ecosystem with server-side compilation, multi-language i18n (24 languages including SOV/VSO grammar transformation), semantic-first multilingual parsing, and comprehensive developer tooling.

What is LokaScript?

LokaScript lets you add interactivity to your HTML using a readable, event-driven syntax directly in your markup:

<button _="on click toggle .active on me">
  Toggle Active
</button>

No JavaScript files to create. No event listeners to wire up. Just declare what should happen, and it happens.

Key Features

  • 43 Commands: Complete command set for DOM manipulation, animations, control flow, async operations, and more
  • 24 Languages: Write in your native language with natural grammar transformation
  • Flexible Bundles: From 1.9KB lite bundle to 203KB full-featured bundle
  • ~85% Compatibility: Works with most existing _hyperscript code
  • 8100+ Tests: Comprehensive test coverage

Quick Example

Here's a simple counter:

<button _="on click increment :count then put :count into me">
  Clicks: 0
</button>

And a more complex example with async operations:

<button _="on click
  add .loading to me then
  fetch /api/data as json then
  put result.message into #output then
  remove .loading from me">
  Load Data
</button>

Next Steps

  1. Installation - Add LokaScript to your project
  2. Bundle Selection - Choose the right bundle size
  3. Commands - Learn the command syntax
  4. Expressions - Understand selectors and values

Installation Preview

The fastest way to try LokaScript:

<script src="https://unpkg.com/@lokascript/core/dist/lokascript-browser.js"></script>

Or with npm:

npm install @lokascript/core

See the full installation guide for all options including the Vite plugin for automatic tree-shaking.