# @peter-schweitzer/ezserver

> BLAZINGLY FAST npm module for backend/REST-API development with 0! dependencies, inspired by express

Latest version **6.0.3** (published 2026-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @peter-schweitzer/ezserver
pnpm add @peter-schweitzer/ezserver
yarn add @peter-schweitzer/ezserver
bun add @peter-schweitzer/ezserver
```

## Health

**Score 55/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.3 |
| Published | 2026-05-09 |
| First published | 2023-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 47.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Peter Schweitzer |
| Maintainers | peter-schweitzer |
| Keywords | simple, http, server, http-server, rest-api, server-side, backend, framework, WebSockets |

## Links

- npm: https://www.npmjs.com/package/@peter-schweitzer/ezserver
- Repository: https://github.com/peter-schweitzer/EZServer
- Issues: https://github.com/peter-schweitzer/EZServer/issues
- npm.io page: https://npm.io/package/@peter-schweitzer/ezserver

## Dependencies (1)

- [@peter-schweitzer/ez-utils](https://npm.io/package/@peter-schweitzer/ez-utils.md) ~0.8.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 6.0.3 (latest) — 2026-05-09
- 6.0.0-canary.0 (canary) — 2025-05-29
- 4.2.0-beta.1 (beta) — 2024-08-21
- 6.0.2 — 2026-05-02
- 6.0.1 — 2026-04-26
- 6.0.0 — 2026-04-06
- 5.1.2 — 2025-05-23
- 5.1.1 — 2025-02-16
- 5.1.0 — 2025-02-16
- 5.0.4 — 2025-02-16
- 5.0.3 — 2025-02-10
- 5.0.2 — 2025-02-02
- 5.0.1 — 2025-01-21
- 5.0.0 — 2025-01-10
- 4.2.0-beta.2 — 2024-08-21
- … 24 more at https://npm.io/package/@peter-schweitzer/ezserver/versions

## README

# EZServer

simple, ultra light weight node.js module with (basically) 0 dependencies for simple backend/REST-API development
_all implemented in around a thousand lines or less_

> EZServer is developed on the current node version (v25)
> but should run on all active LTS versions

## Resolving requests

The most basic way of resolving a request is using the 'add' function of the app.
Eg. to resolve a request to `/myRequest` and respond with `Hello World!` do the following:

```js
import { App, buildRes, MIME } from '@peter-schweitzer/ezserver';

const app = new App();

app.add('/hello-world', function (_req, res, _params) => {
  buildRes(res, 'Hello, World!', { mime: MIME.TEXT });
});

app.listen(8080);
```

on `localhost:8080/hello-world` you should see the text "Hello, World!"

The `req`-Object is passed from the node:http server, but is slightly modified.<br>
EZServer adds the property `uri`, which is very similar to req.url, but URI-decoded and <i style="color: #ff2020">without</i> a query string.<br>
To provide correct type annotations for the `req`-Object the `EZIncomingMessage` type is used.

> for further documentation refer to the [example](./example/index.js)

---
_Source: https://npm.io/package/@peter-schweitzer/ezserver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
