A modern, reactive programming language that compiles to pure HTML/JS - No build tools, no dependencies, just write and run!
EasyScript is designed for rapid web development with built-in reactivity, comprehensive standard library, and intuitive syntax.
- Reactive State Management - Signals with automatic reactivity
- Computed Values - Derived state with dependency tracking
- Effects - Side effects that auto-rerun on changes
- Component System - Reusable UI components with props
- Router - Built-in client-side routing
- Control Flow - if/else, for, while, switch/case, try/catch
- Async/Await - First-class async support
str.titleCase("hello world") // "Hello World"
str.camelCase("hello-world") // "helloWorld"
str.snakeCase("HelloWorld") // "hello_world"
str.isEmail("test@example.com") // true
str.truncate(text, 50, "...")arr.groupBy(users, 'role')
arr.shuffle([1,2,3,4,5])
arr.average([1,2,3,4,5]) // 3
arr.median([1,2,3,4,5]) // 3
arr.unique([1,2,2,3]) // [1,2,3]math.average([1,2,3,4,5])
math.median([1,5,3,4,2])
math.variance(numbers)
math.stdDev(numbers)
math.distance(x1, y1, x2, y2)
math.randomInt(1, 100)date.addDays(new Date(), 7)
date.format(date.now())
date.isToday(someDate)
date.dayOfWeek(new Date())
date.daysBetween(date1, date2)obj.deepClone(object)
obj.deepMerge(obj1, obj2)
obj.pick(user, ['name', 'email'])
obj.omit(user, ['password'])dom.query('.selector')
dom.on(element, 'click', handler)
dom.fadeIn(element, 300)
dom.addClass(element, 'active')storage.local.set('key', value)
storage.local.get('key')
storage.cookie.set('token', 'abc', 7)await http.get(url)
await http.post(url, data)
await http.put(url, data)
await http.uploadFile(url, file)timer.debounce(func, 300)
timer.throttle(func, 1000)
timer.defer(func)validate.isEmail(email)
validate.isURL(url)
validate.required(value)
validate.minLength(str, 5)git clone <repo>
cd EasyScript
npm installCreate hello.es:
page HelloWorld {
state name = "World"
layout: column
style { padding: 40px; }
text "Hello, " + name + "!" {
style { font-size: 2rem; font-weight: bold; }
}
input "Your name" {
bind: name
}
}Compile and run:
node src/index.js hello.es
# Opens hello.html in your browser!node src/index.js <file.es>node src/index.js app.es --watch
# or
node src/index.js app.es -wnode src/index.js app.es --debug
# or
node src/index.js app.es -dnode src/index.js --helppage Counter {
state count = 0 // Reactive signal
button "+" {
onClick -> count = count + 1
}
text "Count: " + count // Auto-updates!
}component UserCard(name, email) {
card {
text name { style { font-weight: bold; } }
text email { style { color: #666; } }
}
}
page Users {
UserCard("Alice", "alice@example.com")
UserCard("Bob", "bob@example.com")
}page TodoList {
state todos = ["Buy milk", "Learn EasyScript", "Build app"]
for todo in todos {
card {
text todo
}
}
}page DataFetcher {
state users = []
button "Load Users" {
onClick -> {
async {
users = await http.get("https://api.example.com/users")
}
}
}
}page Notes {
state notes = []
onMount -> {
state saved = storage.local.get("notes")
if saved {
notes = saved
}
}
button "Save" {
onClick -> storage.local.set("notes", notes)
}
}page Home {
text "Welcome Home"
}
page About {
text "About Us"
}
router Main {
route "/" -> Home
route "/about" -> About
}node src/index.js examples/counter.esDemonstrates: reactive state, computed values, stdlib functions
node src/index.js examples/todo-app.esDemonstrates: CRUD operations, localStorage, filtering, statistics
node src/index.js examples/api-demo.esDemonstrates: async/await, HTTP requests, loading states, error handling
ReactiveArray- Array mutations trigger reactivitycomputed()- Computed signals with dependency trackingeffect()- Auto-running side effectswatch()- Watch signal changes
- 100+ built-in functions across 11 categories
- String validation & transformation
- Array analysis & manipulation
- Math statistics & geometry
- Date/time utilities
- Object deep operations
- DOM manipulation & animations
- Storage (localStorage, sessionStorage, cookies)
- HTTP REST API client
- Timer functions (debounce, throttle)
- Form validation helpers
--watchmode for auto-recompilation--debugmode for verbose output- Colored terminal output
- Better error messages
- Helpful
--helpdocumentation
- Template literals (backticks)
- Multi-line strings
- break/continue in loops
- Enhanced switch/case
- try/catch/finally
- Full async/await support
βββββββββββββββββββ
β .es file β
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β Lexer β Tokenization
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β Parser β AST Generation
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β Compiler β Code Generation
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β .html output β Runtime + App Code
βββββββββββββββββββ
EasyScript is open for contributions! Key areas:
- Additional standard library functions
- IDE/editor plugins
- More examples
- Documentation improvements
MIT License - feel free to use in your projects!
Built with β€οΈ for rapid web development