# @netlify/dev

> Emulation of the Netlify environment for local development

Latest version **5.1.2** (published 2026-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @netlify/dev
pnpm add @netlify/dev
yarn add @netlify/dev
bun add @netlify/dev
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.1.2 |
| Published | 2026-09-16 |
| First published | 2025-04-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.12.0 |
| Dependencies | 14 |
| Unpacked size | 72 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 25 |
| Author | Netlify Inc. |
| Maintainers | netlify-bot, mikewen, youvalv, serhalp-netlify, mlgualtieri-gatsby |

## Links

- npm: https://www.npmjs.com/package/@netlify/dev
- Repository: https://github.com/netlify/primitives
- Homepage: https://github.com/netlify/primitives#readme
- Issues: https://github.com/netlify/primitives/issues
- npm.io page: https://npm.io/package/@netlify/dev

## Dependencies (14)

- [ulid](https://npm.io/package/ulid.md) ^3.0.0
- [@netlify/ai](https://npm.io/package/@netlify/ai.md) ^1.0.1
- [@netlify/blobs](https://npm.io/package/@netlify/blobs.md) 11.1.0
- [@netlify/config](https://npm.io/package/@netlify/config.md) ^25.2.3
- [@netlify/images](https://npm.io/package/@netlify/images.md) 2.0.1
- [@netlify/static](https://npm.io/package/@netlify/static.md) 4.0.0
- [@netlify/headers](https://npm.io/package/@netlify/headers.md) 3.0.1
- [@netlify/runtime](https://npm.io/package/@netlify/runtime.md) 5.0.4
- [@netlify/dev-utils](https://npm.io/package/@netlify/dev-utils.md) 6.0.1
- [@netlify/redirects](https://npm.io/package/@netlify/redirects.md) 4.0.2
- [@netlify/server-dev](https://npm.io/package/@netlify/server-dev.md) 0.1.1
- [@netlify/database-dev](https://npm.io/package/@netlify/database-dev.md) 1.0.1
- [@netlify/functions-dev](https://npm.io/package/@netlify/functions-dev.md) 2.0.7
- [@netlify/edge-functions-dev](https://npm.io/package/@netlify/edge-functions-dev.md) 2.0.1

## Recent versions

- 5.1.2 (latest) — 2026-09-16
- 4.5.6 (missing) — 2025-08-27
- 5.1.1 — 2026-09-14
- 5.1.0 — 2026-09-11
- 5.0.5 — 2026-09-02
- 5.0.2 — 2026-08-28
- 5.0.3 — 2026-08-28
- 5.0.4 — 2026-08-27
- 5.0.1 — 2026-08-18
- 5.0.0 — 2026-08-18
- 4.18.13 — 2026-08-12
- 4.18.12 — 2026-08-04
- 4.18.11 — 2026-07-29
- 4.18.10 — 2026-07-24
- 4.18.9 — 2026-06-26
- … 101 more at https://npm.io/package/@netlify/dev/versions

## README

# @netlify/dev

`@netlify/dev` is a local emulator for the Netlify production environment. While it can be used directly by advanced
users, it is primarily designed as a foundational library for higher-level tools like the
[Netlify CLI](https://docs.netlify.com/cli/get-started/) and the
[Netlify Vite Plugin](https://docs.netlify.com/integrations/vite/overview/).

It provides a local request pipeline that mimics the Netlify platform’s request handling, including support for
Functions, Blobs, Static files, Redirects, and Image CDN.

## 📦 Installation

```bash
npm install @netlify/dev
```

or

```bash
yarn add @netlify/dev
```

## 🚀 Usage

You can use `@netlify/dev` to emulate the Netlify runtime in your own development tooling or custom integrations:

```ts
import { NetlifyDev } from '@netlify/dev'

const devServer = new NetlifyDev({
  blobs: { enabled: true },
  edgeFunctions: { enabled: true },
  environmentVariables: { enabled: true },
  functions: { enabled: true },
  redirects: { enabled: true },
  staticFiles: {
    enabled: true,
    // OPTIONAL: additional directories containing static files to serve
    // Your `projectRoot` (see below) and your site's `publish` dir are served by default
    directories: ['public'],
  },

  // OPTIONAL: base dir (https://docs.netlify.com/configure-builds/overview/#definitions)
  // Defaults to current working directory
  projectRoot: 'site',
  // OPTIONAL: if your local dev setup has its own HTTP server (e.g. Vite), set its address here
  serverAddress: 'http://localhost:1234',
})

await devServer.start()

const response = await devServer.handle(new Request('http://localhost:8888/path'), {
  // An optional callback that will be called with every header (key and value) coming from header rules.
  // See https://docs.netlify.com/routing/headers/
  headersCollector: (key: string, value: string) => console.log(key, value),
})

console.log(await response.text())

await devServer.stop()
```

## 🧪 Contributing and feedback

This module is **experimental**, and we welcome feedback and contributions. Feel free to open issues or pull requests if
you encounter bugs or have suggestions.

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