Documentation

EkkoJS

Getting Started

Overview

Your First Program

Project Structure

Configuration

Guides

Modules & Imports

Permissions

Concurrency

Testing

Using workspaces

Building a Web API

Security Middleware

Packaging

Publishing

API Reference

Ekko (global)

fs

Overview

ekko:fs/path

text

ekko:text/encoding

ekko:text/json

ekko:text/regex

net

Overview

TCP

UDP

DNS

crypto

Overview

Hashing & HMAC

Random values

Symmetric encryption

Key derivation

Digital signatures

ekko:compress

datetime

Overview

Moments

Timezones

ekko:process

ekko:log

ekko:ffi

db

ekko:db

Overview

drivers

Overview

PostgreSQL

MySQL

MSSQL

MongoDB

ekko:db/orm

Overview

Connecting

Defining tables

Querying

Aggregates & grouping

Relations

Joins & subqueries

Writing data

Transactions & pooling

Raw SQL & inspection

extending

Overview

Writing a SQL driver

Writing a non-SQL driver

drivers

Overview

PostgreSQL

MySQL

MSSQL

MongoDB

web

Overview

ekko:web/validate

ekko:web/realtime

ekko:web/graphql

auth

Overview

ekko:auth/rbac

job

ekko:job/cron

ekko:job/queue

ssr

Overview

ekko:ssr/css

test

Overview

ekko:test/assert

Code coverage

Rune Framework

Overview

Routing & Navigation

State (Mimir)

Overview

Atoms

Selectors

React Hooks

SSR & Hydration

Persistence & Sessions

Recipes

API Reference

Styling

SEO

Build & Deploy

App Runtimes

ekko:app/cli

ekko:app/gui

ekko:app/tui

CLI Reference

Overview

Run, Eval & REPL

Project Commands

Package Management

Registry & Publishing

Other commands

Documentation

EkkoJS

Getting Started

Overview

Your First Program

Project Structure

Configuration

Guides

Modules & Imports

Permissions

Concurrency

Testing

Using workspaces

Building a Web API

Security Middleware

Packaging

Publishing

API Reference

Ekko (global)

fs

Overview

ekko:fs/path

text

ekko:text/encoding

ekko:text/json

ekko:text/regex

net

Overview

TCP

UDP

DNS

crypto

Overview

Hashing & HMAC

Random values

Symmetric encryption

Key derivation

Digital signatures

ekko:compress

datetime

Overview

Moments

Timezones

ekko:process

ekko:log

ekko:ffi

db

ekko:db

Overview

drivers

Overview

PostgreSQL

MySQL

MSSQL

MongoDB

ekko:db/orm

Overview

Connecting

Defining tables

Querying

Aggregates & grouping

Relations

Joins & subqueries

Writing data

Transactions & pooling

Raw SQL & inspection

extending

Overview

Writing a SQL driver

Writing a non-SQL driver

drivers

Overview

PostgreSQL

MySQL

MSSQL

MongoDB

web

Overview

ekko:web/validate

ekko:web/realtime

ekko:web/graphql

auth

Overview

ekko:auth/rbac

job

ekko:job/cron

ekko:job/queue

ssr

Overview

ekko:ssr/css

test

Overview

ekko:test/assert

Code coverage

Rune Framework

Overview

Routing & Navigation

State (Mimir)

Overview

Atoms

Selectors

React Hooks

SSR & Hydration

Persistence & Sessions

Recipes

API Reference

Styling

SEO

Build & Deploy

App Runtimes

ekko:app/cli

ekko:app/gui

ekko:app/tui

CLI Reference

Overview

Run, Eval & REPL

Project Commands

Package Management

Registry & Publishing

Other commands

EkkoJS

What is EkkoJS?

EkkoJS is a runtime for JavaScript and TypeScript that makes a clean break from the past. There's no CommonJS, no node_modules, and no URL imports, only modern paradigms: ES modules everywhere, TypeScript that just runs, security that's on by default, and a standard library rich enough to build real applications without reaching for a hundred dependencies.

Why EkkoJS?

  • TypeScript runs directly. Point ekko at a .ts file and it runs, no build step, no config, no separate toolchain.
  • Pure ESM, local-only. Every module is an ES module, and imports always resolve to local files or your declared dependencies. URL imports are a compile-time error, which closes off a whole class of supply-chain risk.
  • Secure by default. Programs start with no access to the file system, network, or other capabilities. You grant exactly what's needed with --allow, nothing leaks in by accident.
  • Batteries included. Over thirty built-in ekko:* modules cover the things real apps need: HTTP servers and clients, a SQL database and ORM, authentication, GraphQL, real-time WebSockets, a full-stack web framework, and even desktop and terminal UI toolkits.
  • Fast. The whole runtime is compiled to native machine code, so startup is quick and throughput is high.

Start here

A taste

Define your data model in its own module:

1
2
3
4
5
6
7
8
9
10
// models/user.ts
import { defineTable, col } from "ekko:db/orm";
 
// ...
 
export const Users = defineTable("users", {
id: col.int().primaryKey(),
name: col.text(),
email: col.text(),
});

Then import it and build an API around it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// server.ts
import { createServer } from "ekko:web";
import { connect } from "ekko:db/orm";
import { Users } from "./models/user.ts";
 
const db = connect("./app.db");
const server = createServer({ port: 3000 });
 
server.get("/users/:id", (req, res) => {
// The id is bound as a parameter, never concatenated into a query.
const user = db.from(Users).where((u) => u.id.eq(req.params.id)).first();
if (!user) return res.status(404).json({ error: "not found" });
res.json(user);
});
 
server.start();
ekko run --allow=net,fs:./app.db server.ts

A web server and a typed query builder, no dependencies to install, and user input is parameterized by default so there's no SQL injection to worry about. That's the EkkoJS experience.