hedystia
TypeScript icon, indicating that this package has built-in type declarations

1.2.17Β β€’Β PublicΒ β€’Β Published

πŸš€ Hedystia Framework

Next-gen TypeScript framework for building type-safe APIs at lightspeed! ⚑

npm version npm downloads license Bun powered

🚨 Early Access Notice

Warning Framework is in active development. Core features are stable but some advanced functionality still being implemented.

🌟 Superpowers

  • 🌐 Multi-runtime support - Bun (default), Deno, Node.js, Vercel, Cloudflare Workers, Fastly Compute, Lambda, etc.
  • πŸ”’ End-to-end type safety - From params to response, full TypeScript integration
  • ⚑ Bun-native performance - Built for Bun runtime with native validation
  • 🧩 Client integration - Auto-generated type-safe HTTP client
  • πŸ›‘οΈ Validation built-in - Zod integration for runtime safety
  • πŸ”Œ Extensible architecture - Middleware, hooks and macros system
  • πŸ“ Standard Schema - Compatibility with the standard schema so you can use it with Zod, Arktype, etc.

πŸš€ Launch in 30 Seconds

  1. Install with Bun:
bun add hedystia
  1. Create your first API:
import { Hedystia, h } from "hedystia";

const app = new Hedystia()
  .get("/hello/:name", (ctx) => `Hello ${ctx.params.name}!`, {
    params: h.object({ name: h.string() }),
    response: h.string()
  })
  .listen(3000);
  1. Generate client and consume API:
import { createClient } from "@hedystia/client";

const client = createClient<typeof app>("http://localhost:3000");

// Fully typed request!
const { data } = await client.hello.name("World").get();
console.log(data); // "Hello World!"

πŸ’‘ Why Developers Love Hedystia

πŸ”„ Full-stack Type Safety

// Server-side validation
.post("/users", (ctx) => {...}, {
  body: h.object({
    email: h.email(),
    age: h.number()
  })
})

// Client-side types
await client.users.post({
  email: "user@example.com", // Autocompletes!
  age: 25 // Type-checked
});

πŸ“– Swagger Integration

import { swagger } from "@hedystia/swagger";

const swaggerPlugin = swagger({
  title: "My API",
  description: "An example API with Swagger",
  version: "1.0.0",
  tags: [
    { name: "users", description: "User operations" },
  ],
});

swaggerPlugin.captureRoutes(app);

app.use("/swagger", swaggerPlugin.plugin).listen(3000);

⚑ Performance First

  • Bun runtime optimized
  • Faster by default
  • Own type validation system
  • Faster than Express
  • Built-in response compression

🧩 Modern Feature Set

// File uploads
.post("/upload", async (ctx) => {
  const formData = await ctx.body; // FormData type
})

// Binary responses
.get("/pdf", () => new Blob([...]), {
  response: h.instanceof(Blob)
})

// Nested routing
.group("/api/v1", (v1) => v1
  .group("/users", (users) => users
    .get("/:id", ...)
  )
)

πŸ› οΈ Development Roadmap

Core Features

  • βœ… HTTP Methods: GET, POST, PUT, PATCH, DELETE
  • βœ… Response Types: JSON, Text, FormData, Blob, ArrayBuffer
  • βœ… Router Groups & Middleware
  • βœ… Type-safe Client Generation
  • βœ… WebSocket Support
  • βœ… Adapter System to work with other frameworks

Advanced Capabilities

  • βœ… Standard Schema Compatibility
  • βœ… Hooks System (onRequest, onError, etc)
  • βœ… Macro System for Auth/Rate Limiting
  • βœ… OpenAPI - Swagger Integration

πŸ’Ό Production Ready

// Error handling
.onError((err) => {
  return Response.json({ 
    error: err.message 
  }, { status: 500 })
})

// Rate limiting macro
.macro({
  rateLimit: () => ({
    resolve: async (ctx) => {
      // Implement your logic
    }
  })
})

πŸ“œ License

MIT License Β© 2025 Hedystia

πŸ—£οΈ Community

Readme

Keywords

none

Package Sidebar

Install

npm i hedystia

Weekly Downloads

45

Version

1.2.17

License

MIT

Unpacked Size

44 kB

Total Files

4

Last publish

Collaborators

  • zastinian