# serve

> Static file serving and directory listing

Latest version **14.2.6** (published 2026-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install serve
pnpm add serve
yarn add serve
bun add serve
```

Provides the command `serve`.

## Health

**Score 50/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 14.2.6 |
| Published | 2026-03-03 |
| First published | 2011-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >= 14 |
| Dependencies | 11 |
| Unpacked size | 25.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9899 |
| Maintainers | rauchg, timneutkens, vercel-release-bot, zeit-bot, leo, arunoda |
| Keywords | vercel, serve, micro, http-server |

## Links

- npm: https://www.npmjs.com/package/serve
- Repository: https://github.com/vercel/serve
- Homepage: https://github.com/vercel/serve#readme
- Issues: https://github.com/vercel/serve/issues
- npm.io page: https://npm.io/package/serve

## Dependencies (11)

- [ajv](https://npm.io/package/ajv.md) 8.18.0
- [arg](https://npm.io/package/arg.md) 5.0.2
- [boxen](https://npm.io/package/boxen.md) 7.0.0
- [chalk](https://npm.io/package/chalk.md) 5.0.1
- [clipboardy](https://npm.io/package/clipboardy.md) 3.0.0
- [compression](https://npm.io/package/compression.md) 1.8.1
- [update-check](https://npm.io/package/update-check.md) 1.5.4
- [@zeit/schemas](https://npm.io/package/@zeit/schemas.md) 2.36.0
- [serve-handler](https://npm.io/package/serve-handler.md) 6.1.7
- [chalk-template](https://npm.io/package/chalk-template.md) 0.4.0
- [is-port-reachable](https://npm.io/package/is-port-reachable.md) 4.0.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 14.2.6 (latest) — 2026-03-03
- 14.2.5-ac84c2e7-20250904133617 (snapshot) — 2025-09-04
- 14.2.5 — 2025-09-04
- 14.2.4 — 2024-10-15
- 14.2.3 — 2024-04-25
- 14.2.2 — 2024-04-22
- 14.2.1 — 2023-08-21
- 14.2.0 — 2023-01-25
- 14.1.2 — 2022-11-18
- 14.1.1 — 2022-11-08
- 14.1.0 — 2022-11-08
- 14.0.1 — 2022-07-14
- 14.0.0 — 2022-07-12
- 14.0.0-canary.0 — 2022-07-12
- 13.0.4 — 2022-07-06
- … 141 more at https://npm.io/package/serve/versions

## README

![Serve Logo](https://raw.githubusercontent.com/vercel/serve/main/media/banner.png)

<div align="center">
  <a aria-label="Vercel logo" href="https://vercel.com">
    <img src="https://img.shields.io/badge/made%20by-vercel-%23000000">
  </a>
  <br>
  <a aria-label="Install Size" href="https://packagephobia.com/result?p=serve">
    <img src="https://packagephobia.com/badge?p=serve">
  </a>
  <a aria-label="Stars" href="https://github.com/vercel/serve/stargazers">
    <img src="https://img.shields.io/github/stars/vercel/serve">
  </a>
  <a aria-label="Build Status" href="https://github.com/vercel/serve/actions/workflows/ci.yaml">
    <img src="https://github.com/vercel/serve/actions/workflows/ci.yaml/badge.svg">
  </a>
</div>

---

`serve` helps you serve a static site, single page application or just a static file (no matter if on your device or on the local network). It also provides a neat interface for listing the directory's contents:

![Listing UI](https://raw.githubusercontent.com/vercel/serve/main/media/listing-ui.png)

> Once it's time to push your site to production, we recommend using [Vercel](https://vercel.com).

## Usage

> `serve` v14 onwards requires Node v14 to run. Please use `serve` v13 if you cannot upgrade to Node v14.

The quickest way to get started is to just run `npx serve` in your project's directory.

If you prefer, you can also install the package globally (you'll need at least [Node LTS](https://github.com/nodejs/Release#release-schedule)):

```bash
> npm install --global serve
```

Once that's done, you can run this command inside your project's directory...

```bash
> serve
```

...or specify which folder you want to serve:

```bash
> serve folder-name/
```

Finally, run this command to see a list of all available options:

```bash
> serve --help
```

Now you understand how the package works! :tada:

## Configuration

To customize `serve`'s behavior, create a `serve.json` file in the public folder and insert any of [these properties](https://github.com/vercel/serve-handler#options).

## API

The core of `serve` is [`serve-handler`](https://github.com/vercel/serve-handler), which can be used as middleware in existing HTTP servers:

```js
const handler = require('serve-handler');
const http = require('http');

const server = http.createServer((request, response) => {
  // You pass two more arguments for config and middleware
  // More details here: https://github.com/vercel/serve-handler#options
  return handler(request, response);
});

server.listen(3000, () => {
  console.log('Running at http://localhost:3000');
});
```

> You can also replace `http.createServer` with [`micro`](https://github.com/vercel/micro).

## Issues and Contributing

If you want a feature to be added, or wish to report a bug, please open an issue [here](https://github.com/vercel/serve/issues/new).

If you wish to contribute to the project, please read the [contributing guide](contributing.md) first.

## Credits

This project used to be called `list` and `micro-list`. But thanks to [TJ Holowaychuk](https://github.com/tj) handing us the new name, it's now called `serve` (which is much more definite).

## Author

Leo Lamprecht ([@leo](https://x.com/leo))

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