Skip to main content
@usenarrator/plugin-elysia The Elysia plugin reads a server as a bulleted list of routes. Each route shows its TypeBox schemas as plain types, its hooks, and the steps of its handler. It also reads lifecycle hooks, plugins such as CORS and Swagger, and the Eden client.
The plugin declares library: { name: "elysia", versions: ">=1.0.0 <2.0.0 || >=2.0.0-0 <3.0.0" }. It only narrates files that import from elysia or belong to a package that depends on it (see Dependency detection), picks the 1.x or 2.x reading from that dependency’s version, and only treats t.* as TypeBox when t comes from Elysia or @sinclair/typebox.

Examples

Routes with schemas
English
Groups and guards
English
The Eden client
English

Elysia 1 and Elysia 2

Elysia 2 changes some route signatures and hook names. In auto mode the plugin understands both. Pass version: 1 or version: 2 to read only one major’s names. See Plugin versioning.

What it covers

  • Apps and routes, including all, route, named handlers, static values, export default, WebSocket routes and mounts.
  • group and guard with the routes inside them.
  • Lifecycle hooks on the app and on single routes, with their scope.
  • state, decorate, derive, resolve, model, macro and error codes.
  • TypeBox schemas from t and @sinclair/typebox, including string formats and numeric strings.
  • Official plugins: CORS, Swagger, OpenAPI, JWT, static files and cron.
  • set.status, set.headers, status(), redirect and listen callbacks.
  • The Eden treaty client and app.handle in tests.

Translating

The English phrasebook is exported as en and typed as ElysiaPhrases.