# fe-dev-server-core

> A dev server for frontend development

Latest version **0.2.0** (published 2026-05-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install fe-dev-server-core
pnpm add fe-dev-server-core
yarn add fe-dev-server-core
bun add fe-dev-server-core
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2026-05-14 |
| First published | 2022-12-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 123.8 KB |
| Known vulnerabilities | 0 (+9 in 3 direct dependencies) |
| Install scripts | no |
| Author | zlcatwu |
| Maintainers | zlcatwu |
| Keywords | fe-dev-server, core |

## Links

- npm: https://www.npmjs.com/package/fe-dev-server-core
- npm.io page: https://npm.io/package/fe-dev-server-core

## Dependencies (14)

- [pino](https://npm.io/package/pino.md) ~8.11.0
- [uuid](https://npm.io/package/uuid.md) ~9.0.0
- [chalk](https://npm.io/package/chalk.md) ~4.1.0
- [lodash](https://npm.io/package/lodash.md) ~4.17.21
- [address](https://npm.io/package/address.md) ~1.2.2
- [fastify](https://npm.io/package/fastify.md) ~4.7.0
- [fs-extra](https://npm.io/package/fs-extra.md) ~10.1.0
- [get-port](https://npm.io/package/get-port.md) ~5.1.1
- [log-update](https://npm.io/package/log-update.md) ^4.0.0
- [http2-proxy](https://npm.io/package/http2-proxy.md) ~5.0.53
- [finalhandler](https://npm.io/package/finalhandler.md) ~1.2.0
- [@fastify/cors](https://npm.io/package/@fastify/cors.md) ~8.2.1
- [terminal-link](https://npm.io/package/terminal-link.md) ~2.1.1
- [@fastify/formbody](https://npm.io/package/@fastify/formbody.md) ~7.3.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2026-05-14
- 0.1.0 — 2026-05-14
- 0.0.19 — 2026-05-14
- 0.0.18 — 2026-05-14
- 0.0.17 — 2026-05-14
- 0.0.16 — 2025-05-23
- 0.0.15 — 2024-01-23
- 0.0.14 — 2024-01-23
- 0.0.13 — 2023-04-17
- 0.0.12 — 2023-04-17
- 0.0.11 — 2023-04-17
- 0.0.10 — 2023-04-16
- 0.0.9 — 2023-04-15
- 0.0.8 — 2023-04-06
- 0.0.7 — 2023-04-02
- … 6 more at https://npm.io/package/fe-dev-server-core/versions

## README

# fe-dev-server-core

> A local server for frontend development, providing function like request proxy, API mock, static assets service and more

## Installation

```bash
mkdir your-server-workspace
cd your-server-workspace

npm init -y
npm install fe-dev-server-cli fe-dev-server-core --save

# install plugins in need
npm install fe-dev-server-plugin-proxy

# create config file in current directory, using -c to specify filename, fe-dev-server.config.js as default
./node_modules/.bin/fe-dev-server init

# modify the generated config file, then run serve to start the server
# the server will restart automatically when config file change
./node_modules/.bin/fe-dev-server serve
```

`fe-dev-server.config.js`

```javascript
const { ProxyPlguin } = require('fe-dev-server-plugin-proxy');

/**
 * @type {import("fe-dev-server-core").FeDevServerCfg}
 */
const config = {
  port: 8080,
  host: 'localhost',
  https: false,
  logger: { level: 'info' },
  plugins: [
    // register the plugin in need, proxy for example
    new ProxyPlguin({
      cfg: {
        target: 'https://www.google.com',
      },
    }),
  ],
};

module.exports = config;
```

## Config

### host

string, Default: 'localhost' - serving host

### port

number, Default: random available port - serving port

### https

false / https.ServerOptions, Default: false - serving ssl config

### logger

false / object, Default: false (alias for slient) - logger options

logger.level: string - slient / trace / debug / info /warn / error / fatal

### realTimeLog

real time log is a friendly display mode for key infomation, usually used by user

### operation

object - `operation` can create additional server, which can provide APIs for external invocation through the specified methods defined in the plugin

operation.enable: boolean, Default: false - weather to enable operation server

operation.host: string, Default: 'localhost' - serving host

operation.port: number, Default: random available port - serving port

operation.https: false / https.ServerOptions, Default: false - serving ssl config

**conflict with logger(console), should only choose one from logger(console) or real time log**

false / object, Default: see below - real time log options

realTimeLog.enable: boolean, Default: true - wheather to show real time log

realTimeLog.interval: number, Default: 100 - refresh time for real time log

### addReplyHeader

boolean, Default: false - wheather to add response header marking the plugin make response

### http2Wrapper

object - `http2Wrapper` will create an additional server, which can provide an http2 request handler before fe-dev-server

http2Wrapper.enable: boolean, Default: false - weather to enable wrapper server

http2Wrapper.host: string, Default: 'localhost' - serving host

http2Wrapper.port: number, Default: random available port - serving port

http2Wrapper.serverOptions: http2.SecureServerOptions, - serving http2 config

**If you are developing plugin with hijack call, you should implement this manually**

### plugins

array of FeDevServerPlugin - serving logic depends on the plugins you create

plugin has some common config:

- enable: true / false, Default: true - activation of the plugin
- cfg: object, Default: undefined - config of the plugin
- match: string / RegExp / function, Default: '/' - activation of the plugin according to the request
- macth: string - using pathname prefix to devide the activation of the plugin, for examples, '/api/v1/login' is active while '/api/v2/login' is inactive when match is '/api/v1'
- match: RegExp - using pathname to check with the regexp, for exampels, '/api/v1/login' is active while '/api/v2/login' is inactive when match is `/v1/`
- match: function - pathname / method / search / headers passed to function, write your custom logic to decide the activation
- throwNotFoundWhenUnreplied: boolean, Default: false - throw not found when this plugin's handler executed without response
- uuid: string, Default: random uuID string - a unique string for distinguish plugin
- operation: object - config of operation in plugin
- operation.enable: boolean - weather to enable operation methods in plugin
- operation.urlPrefix: string - the url prefix for accessing the API

## Built-in plugins

- [fe-dev-server-plugin-proxy](../proxy/README.md): request proxy
- [fe-dev-server-plugin-mock](../mock/README.md): JSON API response mock using mock file in file system
- [fe-dev-server-plugin-static](../static/README.md): static assets service
- [fe-dev-server-plugin-capture](../capture/README.md): capture JSON API response from other plugin, and reply as server using captured files

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