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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@epoint-fe/f9server

v1.2.0

Published

## 背景

Downloads

10

Readme

更简单启动F9web服务

背景

F9 框架自从 F9.5 开始,使用了组件化的模式,简单来说,就是将功能模块拆分到了不同的jar包里面去。好处就不说了,但给前端开发人员带来的一个痛点问题就是 很难再启动一个web服务器来查看和修改页面了

以下是几个场景实例:

  1. 我要修改主题包里面的页面,但是我拉了主题包之后,主题包里面只有主题页面,框架资源一个都没有,我没办法在浏览器里面看到主题的页面效果。
  2. 我要修改工作流组件, 但是我拉了工作流代码后看不到效果。

以上问题怎么办?

  1. 自己本地跑java工程. 但作为一个前端, 经常会启动失败, 不知道如何处理; 另一点, 太吃资源, 电脑带不起。
  2. 自己把相关页面整合到以一个目录下,再启动。但提交的时候还得再复制回去,太麻烦容易出错。
  3. 历史解决方案 easy-server . 但此方案需要拉源码,且需要放置在一个目录,使用不便。

原因分析: 组件化,不同的模块在不同的包里面,只拉一个包的情况下,没有其他的页面资源,所以无法启动一个web服务器来查看页面效果。

使用

安装

npm install -g @epoint-fe/f9server

配置

在项目目录下创建一个配置文件,支持以下格式:

1. CommonJS 格式 (.epoint.server.js.epoint.server.cjs)

module.exports = {
    watch: true,
    paths: {
        // 配置格式 key - value , 
        // key 为包名 fui 或 action2rest 需固定,因为有额外的特殊逻辑 , 其他依赖包任意写,无实际作用
        // value 为本地的路径,配置到java工程目录即可
        fui: 'D:\\Code\\EpointFrame\\F9.5\\epoint-fui', // 配置到java工程目录即可
        action2rest: 'D:\\Code\\EpointFrame\\F9.5\\epoint-shell-actionengine', // 可选 按自己的需求来
        'epoint-ui-sheet': 'D:\\Code\\EpointFrame\\com\\epoint-ui-sheet\\epoint-ui-sheet' // 可选 按自己的需求来
    },
    // 启动的端口号
    port: 3000,
    // 应用名, 前后不带 / 
    appName: 'epoint-excel-web',
    // 响应头配置
    headers: {
        // "Content-Security-Policy": ""
    }
};

2. ES模块格式 (.epoint.server.mjs)

export default {
    watch: true,
    paths: {
        fui: 'D:\\Code\\EpointFrame\\F9.5\\epoint-fui',
        action2rest: 'D:\\Code\\EpointFrame\\F9.5\\epoint-shell-actionengine',
        'epoint-ui-sheet': 'D:\\Code\\EpointFrame\\com\\epoint-ui-sheet\\epoint-ui-sheet'
    },
    port: 3000,
    appName: 'epoint-excel-web',
    headers: {
        // "Content-Security-Policy": ""
    }
};

注意:

  • 系统会按优先级自动查找 .mjs.cjs.js 格式的配置文件
  • 配置文件会由 f9server 工具统一解析,不受用户项目模块格式影响
  • 即使在 ES模块项目中,也可以使用 CommonJS 格式的配置文件

启动和使用

基本启动

在当前项目目录下,执行以下命令:

f9server 

命令行选项

# 显示帮助信息
f9server --help
f9server -h

# 显示版本号
f9server --version
f9server -v

# 显示所有可用版本
f9server --versions

# 指定端口启动
f9server -p 8080

版本管理

f9server 在启动时会:

  • 显示当前版本号
  • 自动检查是否有新版本可用
  • 如果发现新版本,会提示更新命令
# 查看所有可用版本
f9server --versions

# 输出示例:
# 可用版本:
#   1.0.0
#   1.1.0
#   1.1.1
#   1.1.2
#   1.1.3
#   1.1.4 (当前)

使用示例

在主题包目录下,新增配置文件。 主题包无需其他资源,只需要配置 fui 即可。

module.exports = {
    watch: true,
    paths: {
        fui: 'D:\\Code\\EpointFrame\\F9.5\\epoint-fui'
    },
    port: 3000,
    appName: 'epoint-web'
};

效果:

此页面启动需要依赖 fui 和 action2rest 两个包,所以需要配置两个包的路径,此外还依赖我们自己封装过的表格资源,因此启动页面需要如下3个包,配置好地址即可.

module.exports = {
    watch: true,
    paths: {
        fui: 'D:\\Code\\EpointFrame\\F9.5\\epoint-fui', // 配置到java工程目录即可
        action2rest: 'D:\\Code\\EpointFrame\\F9.5\\epoint-shell-actionengine',
        'epoint-ui-sheet': 'D:\\Code\\EpointFrame\\com\\epoint-ui-sheet\\epoint-ui-sheet'
    },
    port: 3000,
    appName: 'epoint-excel-web'
}

效果:

故障排除

配置文件加载问题

如果遇到 module is not defined 错误,说明配置文件格式与项目环境不匹配:

解决方案:

  1. 使用 .epoint.server.cjs 扩展名强制使用 CommonJS 格式
  2. 使用 .epoint.server.mjs 扩展名强制使用 ES模块格式
  3. 新版本的 f9server 已解决此问题,建议更新到最新版本

版本检查失败

如果版本检查功能异常,可能是网络问题:

  • 版本检查失败不会影响主程序运行
  • 可以手动运行 f9server --versions 查看版本

端口被占用

如果默认端口被占用,系统会自动寻找可用端口,或者手动指定:

f9server -p 8080

Change Log

参考 CHANGELOG.md

Feature

  • [x] 支持修改资源自动刷页面
  • [x] 支持 CommonJS 和 ES模块两种配置文件格式
  • [x] 自动版本检查和更新提示
  • [x] 完整的命令行参数支持
  • [x] 配置文件智能加载(不受用户项目模块格式影响)
  • [ ] 支持直接配置一个jar文件作为依赖
  • [ ] fui 和 action2rest 包支持免配置(可以直接使用一个线上部署好的地址)

如果你有更多使用建议,可通过issue提交。