Skip to content

Examples

A collection of practical examples and edge cases for Elysia.js. Each example includes runnable code and comprehensive tests executed in both Bun and Node.js runtimes.

Legend

  • ✅ Test with expectations passed
  • ❌ Test failed or had errors
  • 🏃 Test executed successfully (no specific expectations)
  • N/A Test not available for this runtime

Examples Overview

Examplebunnode
basic-query-parsing
basic-return
basic-routing
body-parsing
context🏃🏃
errors-built-in
hook-interceptor-vs-local🏃🏃
hook-list🏃🏃
hook-local🏃🏃
hook-log🏃🏃
hook-onrequest🏃🏃
hook-order🏃🏃
issue-0859-bug1🏃🏃
issue-0859-bug2🏃🏃
plugin-http-errors🏃🏃
response-json🏃🏃
response-string🏃🏃
response-validation
response-validation-additional-properties
response-validation-failed
set-headers-vs-response🏃🏃
set-status-vs-response🏃🏃
smallest🏃🏃

Summary

  • Total Examples: 23
  • Total Tests: 52
  • Total Test Runs: 104
  • Supported Runtimes: bun, node