npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

fe-dev-server-core

v0.0.16

Published

A dev server for frontend development

Downloads

42

Readme

fe-dev-server-core

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

Installation

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

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