npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nestjs-platform-elysia

v0.2.0

Published

NestJS HTTP adapter for the Elysia web framework on Bun

Downloads

712

Readme

nestjs-platform-elysia

NestJS HTTP adapter for Elysia on Bun.

📚 Full documentation →

npm CI License: MIT

⚠️ Bun runtime only. Elysia uses Bun.serve() internally and does not run on Node.js.

Why

NestJS gives you DI, modules, guards, pipes, interceptors, exception filters. Elysia gives you Bun-native performance, end-to-end type safety, TypeBox/Zod validation at the framework level, lifecycle hooks, and a plugin ecosystem.

This adapter lets you keep both: write Nest controllers as usual while still being able to register Elysia plugins, attach TypeBox schemas, mount sub-apps, and use app.handle() for testing — without losing what makes Elysia worth choosing.

Install

bun add nestjs-platform-elysia @nestjs/common @nestjs/core elysia

Quick start

import { NestFactory } from '@nestjs/core';
import { ElysiaAdapter, type NestElysiaApplication } from 'nestjs-platform-elysia';
import { AppModule } from './app.module';

const app = await NestFactory.create<NestElysiaApplication>(
  AppModule,
  new ElysiaAdapter(),
);
await app.listen(3000);

Guides

| Guide | What's inside | |---|---| | Getting Started | Install, bootstrap, project layout | | Route Decorators | @RouteSchema, @RouteHook, @RouteConfig, @RouteDetail | | Body Parsing | rawBody, custom parsers, size limits | | Server-Sent Events | @Sse() over Web Streams, backpressure, disconnects | | File Uploads | Native multipart, @UploadedFile(), @UploadedFiles() | | Static Assets | useStaticAssets(), Range requests, traversal protection | | Trust Proxy | X-Forwarded-* resolution, Express-compatible hop count | | WebSockets | @WebSocketGateway on the same Bun server, hardening config | | Testing | app.inject() patterns, fixtures | | API Reference | Adapter, request, reply, interfaces |

What's supported

  • All HTTP methods, route params, query, body, default status codes
  • Full Nest pipeline: Guards, Pipes, Interceptors, Exception Filters
  • @RouteSchema with TypeBox/Zod for framework-level validation
  • Versioning: URI, Header, Media-Type, Custom
  • CORS via @elysiajs/cors
  • MiddlewareConsumer.apply().forRoutes() (Express-style middleware)
  • Server-Sent Events (@Sse()) streamed over Web Streams, with client-disconnect cleanup
  • File uploads via native multipart — @Body(), @UploadedFile(), @UploadedFiles() yield Web File objects (no multer)
  • Static file serving via useStaticAssets(root, { prefix }), backed by Bun.file with path-traversal protection
  • Hybrid apps: HTTP server + Nest microservices (TCP validated)
  • app.register(plugin) for Elysia plugins (swagger, bearer, openapi, etc.)
  • app.mount(path, handler) for sub-apps and fetch handlers
  • app.inject(Request) for programmatic testing
  • WebSocket gateways on the same Bun server (no second port)

Known limitations

  • setViewEngine() / @Render() — not implemented (no SSR templating support).
  • @Req() / @Res() — receive ElysiaRequest / ElysiaReply wrappers, not Express request/response. Express-only APIs like .is(), .accepts(), .signedCookies are not exposed.
  • Microservice transports are runtime-dependent — each transport must support Bun (TCP validated; others untested).

Versioning

Pre-1.0. APIs may change between minor versions. See CHANGELOG.md.

Releasing

Releases are cut by pushing a v*.*.* tag — see .github/workflows/release.yml. The workflow runs bun run check, verifies the tag matches package.json#version, publishes to npm via OIDC Trusted Publishing with provenance, and creates a GitHub Release.

License

MIT