Skip to main content
v0.2.3

API Reference

Complete documentation for the Lesan framework.
Explore server APIs, models, queries, types, and cross-platform guides.

โŒ˜K
Explore

API Sections

Jump into any section of the API documentation.

Example

Quick Start

Define models and actions in a few lines of code.

example.ts
import { lesan } from "@hemedani/lesan";
// Define a model
const user = core.odm.newModel("user", {
name: string(),
email: string(),
});
// Create an action
const createUser = core.acts.setAct("user", "create", {
validator: user.schemaInp(),
fn: async ({ body }) => {
return await user.insertOne(body);
},
});
// Run the server
await core.runServer({ port: 1366 });

Installation

Install Lesan via your preferred package manager.

bash
npm install @hemedani/lesan

Requirements

  • โœ“ Node.js 18+ / Bun 1.0+ / Deno 1.35+
  • โœ“ TypeScript 5.0+
  • โœ“ MongoDB 5.0+

Latest Updates

v0.2.3New query engine, improved type inference, Deno Deploy support.
v1.9Bun adapter optimizations, relation hooks.
View full changelog โ†’

Ready to dive deeper?

Start with the Quick Start guide or explore the full API reference.