@eveshipfit/dogma-engine

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

Library to calculate statistics for EVE Online ship fits

原始使用文档
文档目录3 节
  1. Install
  2. Usage
  3. More

EVEShip.fit's Dogma Engine for Javascript

npm Discord

This library calculates accurately statistics of an EVE Online ship fit.

The input are several data-files provided by EVE Online, together with a ship fit. The output are all the Dogma attributes of the ship, its items and the character.

The engine is written in Rust and runs as WebAssembly, so everything is calculated in the browser; no server needed.

Install

@eveshipfit/sde ships sde.dat in its dist folder; serve or bundle that file.

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

The package is an ES module with TypeScript types included, and it runs anywhere: under a bundler (Vite, webpack, ...), from a CDN, or in a plain <script type="module">.

Usage

The default export loads the WebAssembly and has to be awaited once before any other function is called.

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 may only be called once.

An EFT import matches the English names in sde.dat. To also match the other languages EVE supports, hand names.dat (also in @eveshipfit/sde) to load_names the same way, after load_sde.

Fits and calculations are plain objects, described by the included TypeScript types. What every field means is explained under Input and output.

More

How the engine works, the attributes EVEShip.fit adds and the fitting rules it validates are all in the main repository.

版本与发布记录

@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 是什么?

Library to calculate statistics for EVE Online ship fits

如何安装 @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 和提交记录判断。