Skip to content

Latest commit

 

History

History
220 lines (185 loc) · 9.02 KB

index.md

File metadata and controls

220 lines (185 loc) · 9.02 KB
aside editLink title titleTemplate description layout
false
false
tinyhttp
title · 0-legacy, tiny & fast web framework as a replacement of Express
modern Express-like web framework written in TypeScript and compiled to native ESM with minimal dependencies.
home
<script setup lang="ts"> import { VPButton } from 'vitepress/theme' </script>
tinyhttp logo
tinyhttp is a modern, lightweight and modular Express-like web framework for Node.js.

::: code-group

npm i @tinyhttp/app
pnpm i @tinyhttp/app
bun i @tinyhttp/app

:::

stars
2.7k
coverage
97%
Express compatibility
Works with most of the Express middleware out of the box.
Async support
async / await no longer crashes or hangs your app.
Fast
58% faster than Express
See more
Prebuilt middleware
Re-written with latest ECMAScript and types out of the box.
import { App } from '@tinyhttp/app'
import { logger } from '@tinyhttp/logger'

const app = new App()

app
  .use(logger())
  .get('/', (_, res) => void res.send('<h1>Hello World</h1>'))
  .get('/page/:page/', (req, res) => {
    res.status(200).send(req.params)
  })
  .listen(3000)

Features

  • ESM-only. Embraces the standard modules.
  • No polyfills. 75% smaller install size, faster CI builds.
  • Strongly typed. Works well with TypeScript.

Support

Help support future development and make tinyhttp a sustainable open-source project:

Used by

<style scoped> html:not(.dark) img.dark { display: none; } .dark img.light { display: none; } .card { background-color: var(--vp-c-bg-soft); } .language-bash { overflow-y: hidden; } .vp-code-group, .vp-code-group .language-bash { height: 100%; } .vp-code-group .language-bash { height: 100%; margin-bottom: 0px; } .vp-code-group { margin-top: 0px; } .vp-code-group .blocks { height: calc(100% - 37px); } .vp-code-group .tabs label { font-size: 16px; } .vp-code-group .tabs { justify-content: left; } .vp-code-group .shiki { padding-top: 16px; } .vp-code-group code { font-size: 22px; } .tabs { display: flex; justify-content: center; } </style>