@bpmn-io/feel-editor

中文文档
2.8.1发布于 2026/10/28MITES Module近 30 天下载 36.9万

感受表达式编辑器 .

中文使用文档
文档目录6 节
  1. 使用量
  2. 变量
  3. 内容属性
  4. 活动
  5. 黑客项目
  6. 许可证

@bpmn-io/feel-编辑器

可嵌入编辑器 感觉表达式。 。 。 .

使用量

要开始, 创建一个感觉编辑实例 :

import FeelEditor from '@bpmn-io/feel-editor';

const editor = new FeelEditor({
  container
});

配置感官方言( 表达式或无函数测试) :

const editor = new FeelEditor({
  container,
  dialect: 'unaryTests' // defaults to 'expression'
});

您可以提供起始文档并查看更改:

const editor = new FeelEditor({
  container,
  onChange,
  onKeyDown,
  onLint,
  value
});

变量

您可以提供用于自动补全的变量数组 。 嵌入 结构得到支持. 变量需要采用以下格式:

const editor = new FeelEditor({
  container,
  variables: [
    {
      name: 'variablename to match',
      detail: 'optional inline info',
      info: 'optional pop-out info',
      entries: [
        {
          name: 'nested variable',
          ...
        }
      ]
    }
  ]
});

变量可通过 FeelEditor#setVariables()数字 :

editor.setVariables([
  {
    name: 'newName',
    detail: 'new variable inline info',
    info: 'new pop-out info'
  }
]);

内容属性

您可以提供将设置在内容可编辑 div 上的属性 :

const editor = new FeelEditor({
  container,
  contentAttributes: {
    'aria-label': 'Expression editor'
  }
});

活动

你可以听编辑发来的消息:

const editor = new FeelEditor({
  container
});

editor.on('lint', ({ diagnostics }) => console.log(diagnostics));

黑客项目

要得到开发设置 确保有 节点JS 已安装. 设置后立即复制项目并执行

npm install
npm start

许可证

麻省理工学院

版本与发布记录

@bpmn-io/feel-editor 共发布 45 个版本,首次发布于 2022/06/14;过去 12 个月发布了 14 个版本。

版本发布日期距今
2.8.1latest2026/10/2811 天前
2.8.02026/09/141 个月前
2.7.12026/08/212 个月前
2.7.02026/08/132 个月前
2.6.02026/06/184 个月前
2.5.22026/03/058 个月前

其他发布通道:exp → 0.0.1-alpha0。

关于 @bpmn-io/feel-editor 的常见问题

@bpmn-io/feel-editor 是什么?

感受表达式编辑器 .

如何安装 @bpmn-io/feel-editor?

在项目目录运行 npm install @bpmn-io/feel-editor,或使用 pnpm add / yarn add / bun add。

@bpmn-io/feel-editor 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bpmn-io__feel-editor 是否存在。

@bpmn-io/feel-editor 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bpmn-io/feel-editor 可以商用吗?

@bpmn-io/feel-editor 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bpmn-io/feel-editor 的下载量有多少?

根据 npm 官方下载统计,@bpmn-io/feel-editor 在 2026/10/09 – 2026/11/07 这 30 天内被下载 368,811 次,日均约 12,294 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bpmn-io/feel-editor 还在维护吗?

最新版本 2.8.1 发布于 2026/10/28(11 天前);至今共发布 45 个版本,其中过去 12 个月发布了 14 个;首次发布于 2022/06/14。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。