@eveshipfit/dogma-engine

中文文档
15.0.0发布于 2026/11/13MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 3879

用于计算 EVE Online 船舶适配量统计数据的图书馆

中文使用文档
文档目录3 节
  1. 安装
  2. 使用量
  3. 再来

EVEShip.fit 为 Javascript 设计的多格玛引擎

npm Discord

这个库精确地计算出一个EVE Online ship fit的统计数据.

投入是EVE Online公司提供的几个数据文件,以及一个适合的船. 输出是舰只的所有道克玛属性,其物品和人物.

引擎以 Rust 写成,并以 Web Assembly 运行,所以一切都在浏览器中计算;不需要服务器.

安装

@eveshipfit/sde 船舶 sde.dat 联合国 dist 文件夹; 服务或捆绑文件.

npm install @eveshipfit/dogma-engine @eveshipfit/sde

软件包是一个ES模块,包含TypeScript类型,它随处运行:在捆绑器下 (Vite,webpack,.),来自CDN,或平地 <script type="module">。 。 。 .

使用量

默认导出会加载 Web Assembly, 在调用其他函数前必须等待一次 .

import wasmInit, {
  load_sde,
  load_eft,
  save_eft,
  load_esi_fitting,
  save_esi_fitting,
  load_dna,
  post_load,
  load_killmail,
  load_link,
  calculate,
  beacon,
} from "@eveshipfit/dogma-engine";

await wasmInit();

const sde = await fetch("/sde.dat").then((response) => response.arrayBuffer());
const buildNumber = load_sde(new Uint8Array(sde));
const fit = {
  ship: { type_id: 587 },
  items: [{ type_id: 2873, slot: { type: "high", index: 0 }, state: "active", charge: { type_id: 185 } }],
  character: { skills: { 3300: 5 } },
};

const calculation = calculate(fit);
/* Or if you want to know the source of the effects: */
const withSources = calculate(fit, { sources: true });
/* Or if you have a beacon in space (like wormhole effects): */
const withBeacon = calculate({ ...fit, incoming: beacon(beaconTypeId) });
/* Or if you have an EFT, the text format EVE copies a fit to the clipboard in: */
const imported = calculate(load_eft("[Rifter, My Rifter]\n200mm AutoCannon I"));
/* And to write a fit back out as EFT: */
const eft = save_eft(fit);
/* Or if you have a fitting a character saved in game, as ESI returns it (and the other way around): */
const fromEsi = load_esi_fitting(fitting);
const toEsi = save_esi_fitting(fit);
/* Or if you have DNA, the fits EVE links to in chat, with or without its `fitting:` prefix: */
const fromDna = load_dna(dna);
/* EFT, ESI and DNA have no states; with the skills set, this sets the ones EVE gives an imported fit: */
const settled = post_load({ ...fromEsi, character: { skills } });
/* Or if you have a killmail, as ESI returns it, for the fit of the ship that died: */
const fromKillmail = load_killmail(killmail);
/* Or if you have an EVEShip.fit link, `<version>:<payload>`, with the payload gunzipped and unbase64'd: */
const fromLink = load_link(version, payload);

/* What EVE would not let you fly, in `violations` of the calculation: */
const validated = calculate(fit, { validate: true });

load_sde 只能调用一次.

EFT 导入符合英文名称 sde.dat。 。 。 . 同时匹配 EVE 支持的其他语言, 手 names.dat (另见 @eveshipfit/sde改为: load_names 同样的方式,之后 load_sde。 。 。 .

匹配和计算是平面对象,由包含的TypeScript类型描述. 每一个字段意味着什么 投入和产出。 。 。 .

再来

引擎是如何工作的,属性 EVEShip.fit 添加及其验证的适配规则都包含在 主要仓库。 。 。 .

版本与发布记录

@eveshipfit/dogma-engine 共发布 30 个版本,首次发布于 2026/09/13;过去 12 个月发布了 30 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
15.0.0latest2026/11/131 天前
14.2.12026/11/121 天前
14.2.02026/11/121 天前
14.1.02026/11/0311 天前
14.0.02026/11/0212 天前
13.7.02026/10/3113 天前

关于 @eveshipfit/dogma-engine 的常见问题

@eveshipfit/dogma-engine 是什么?

用于计算 EVE Online 船舶适配量统计数据的图书馆

如何安装 @eveshipfit/dogma-engine?

在项目目录运行 npm install @eveshipfit/dogma-engine,或使用 pnpm add / yarn add / bun add。

@eveshipfit/dogma-engine 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@eveshipfit/dogma-engine 支持 ESM 还是 CommonJS?

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

@eveshipfit/dogma-engine 可以商用吗?

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

@eveshipfit/dogma-engine 的下载量有多少?

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

@eveshipfit/dogma-engine 还在维护吗?

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