Powered by uWebSockets.js
HyperExpress aims to be a simple yet performant HTTP & Websocket Server. Combined with the power of uWebsockets.js, a Node.js binding of uSockets written in C++, HyperExpress allows developers to unlock higher throughput for their web applications with their existing hardware. This can allow many web applications to become much more performant on optimized data serving endpoints without having to scale hardware.
Some of the prominent highlights are:
- Simplified HTTP & Websocket API
- Server-Sent Events Support
- Multipart File Uploading Support
- Modular Routers & Middlewares Support
- Multiple Host/Domain Support Over SSL
- Limited Express.js API Compatibility Through Shared Methods/Properties
See > [Benchmarks] for performance metrics against other webservers in real world deployments.
HyperExpress v7 supports the active even-numbered Node.js release lines 22, 24, and 26 and can be installed using Node Package Manager (npm). HyperExpress remains CommonJS-only and preserves its existing snake_case API.
npm i hyper-express
HyperExpress uses the native uWebSockets.js addon. Its prebuilt binaries support Tier 1 macOS and Windows platforms, and glibc-based Tier 1 Linux distributions. Alpine Linux uses musl instead of glibc; plain Alpine and Alpine with gcompat are not supported because the native addon can terminate with SIGSEGV. Use a Debian or Ubuntu based Node.js image for reliable container deployments.
- See
> [Migrating from v6 to v7]for breaking changes and newly exposed APIs. - See
> [Examples & Snippets]for small and easy-to-use snippets with HyperExpress. - See
> [Server]for creating a webserver and working with the Server component. - See
> [Router]for working with the modular Router component. - See
> [Request]for working with the Request component made available through handlers. - See
> [Response]for working with the Response component made available through handlers. - See
> [Websocket]for working with Websockets in HyperExpress. - See
> [Middlewares]for working with global and route-specific Middlewares in HyperExpress. - See
> [SSEventStream]for working with Server-Sent Events based streaming in HyperExpress. - See
> [MultipartField]for working with multipart requests and File Uploading in HyperExpress. - See
> [SessionEngine]for working with cookie based web Sessions in HyperExpress. - See
> [LiveDirectory]for implementing static file/asset serving functionality into HyperExpress. - See
> [HostManager]for supporting requests over muliple hostnames in HyperExpress.
- HyperExpress is mostly compatible with
Expressbut not 100% therefore you may encounter some middlewares not working out of the box. In this scenario, you must either write your own polyfill or omit the middleware to continue. - The uWebsockets.js version header is disabled by default. You may opt-out of this behavior by setting an environment variable called
KEEP_UWS_HEADERto a truthy value such as1ortrue. - Still having problems? Open an
> [Issue]with details about what led up to the problem including error traces, route information etc etc.
To run HyperExpress functionality tests locally on your machine, you must follow the steps below.
- Clone the HyperExpress repository to your machine.
- Run
npm ciin the root directory. Test-only dependencies are installed from the root lockfile. - Run
npm testfor runtime tests. - Run
npm run test:typesfor positive and negative TypeScript fixtures. - Run
npm run test:loadfor the heavier HTTP, multipart, abort, WebSocket, and memory stress gate.