@josd/eyecode

中文文档
0.1.13发布于 2026/11/01MITES Module零依赖构建来源已验证

A dependency-free JavaScript rule language with forward and backward reasoning and checkable proofs.

原始使用文档

eyecode

DOI npm

eyecode is a JavaScript rule language with forward and backward reasoning and checkable proofs. You write facts and rules in plain JavaScript; eyecode draws conclusions, and every conclusion can come with a proof that a separate checker verifies against your program. It runs as a command-line program, a JavaScript library, and a browser application, with no dependencies.

  • Playground: run programs in your browser.
  • Guide: run programs, write rules, check proofs, use the library, and develop eyecode.
  • Specification: the language, its canonical text, the proof format, and the C1–C8 checks.
  • Examples: 72 runnable programs, with their conclusions, proofs and check reports, and a card deck for each.
  • Conformance suite: 321 cases that test any implementation of the specification through its command line.
fact(type('socrates', 'human'))
fact(subclass_of('human', 'mortal'))
implies([type(S, A), subclass_of(A, B)], type(S, B))
query(type(X, Y))
node bin/eyecode.js examples/socrates.js
node bin/eyecode.js --proof examples/socrates.js > /tmp/proof.js
node bin/eyecode.js --check-proof /tmp/proof.js examples/socrates.js

MIT licensed; see LICENSE.md.

版本与发布记录

@josd/eyecode 共发布 12 个版本,首次发布于 2026/10/31;过去 12 个月发布了 12 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.13latest2026/11/011 天前
0.1.122026/11/011 天前
0.1.112026/11/012 天前
0.1.102026/11/012 天前
0.1.92026/11/012 天前
0.1.82026/11/012 天前

关于 @josd/eyecode 的常见问题

@josd/eyecode 是什么?

一种无依赖的JavaScript规则语言,具有向前和向后推理以及可检查的证明。

如何安装 @josd/eyecode?

在项目目录运行 npm install @josd/eyecode,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 eyecode,可以用 npx eyecode 直接运行。

@josd/eyecode 支持 TypeScript 吗?

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

@josd/eyecode 支持 ESM 还是 CommonJS?

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

@josd/eyecode 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@josd/eyecode 可以商用吗?

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

@josd/eyecode 还在维护吗?

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