Docs / Core
Core
@hopak/core — the framework itself. Install card only; full docs are under Core / Database / Serving.
@hopak/core is the framework. This page is a thin install card — every exported symbol is documented under the dedicated feature page.
Install
Added automatically by hopak new. To add to an existing Bun project:
bun add @hopak/core
- Runtime: Bun ≥ 1.3
- Peer:
@hopak/common - Current version: 0.5.0
Where each export is documented
| Topic | Exports | Page |
|---|---|---|
| Models + field builders | model, text, number, boolean, date, timestamp, email, url, phone, password, secret, token, json, enumOf, file, image, money, belongsTo, hasOne, hasMany | Models |
| Routing | defineRoute, hopak | Routes, Middleware |
| CRUD helpers | crud.list, crud.read, crud.create, crud.update, crud.patch, crud.remove | CRUD |
| Database | Database, ModelClient, WhereClause, FilterOp, FindManyOptions | Database |
| Migrations | MigrationContext, Migration | Migrations |
| Validation | buildModelSchema, validate, serializeForResponse | Validation |
| Errors | HopakError, ValidationError, Unauthorized, Forbidden, NotFound, Conflict, RateLimited, InternalError, ConfigError | Errors |
| Config | defineConfig | Configuration |
| Middleware | requestId, requestLog, cors | Middleware, CORS |
License
MIT.