@arcships/rutis-bun

中文文档
0.21.0发布于 2026/11/06MITES Module零依赖近 30 天下载 3580

The Bun runtime of rutis: runs JavaScript and TypeScript plugins in Bun for a rutis host

原始使用文档

@arcships/rutis-bun

The Bun runtime of rutis: runs JavaScript and TypeScript plugins in Bun for a rutis host.

A host starts it as one process and runs plugins in it as rows named bun:<module>:

{
  "runtimes": { "bun": { "project": "." } },
  "rows": [
    { "id": "weather", "name": "bun:@acme/weather" },
    { "id": "report", "name": "bun:./report.ts", "inject": ["weather"] }
  ]
}
  • Plugins are written with @arcships/rutis (definePlugin), or as a module exporting apply(ctx, config) with inject, optional (services used when there, read with ctx.get; rutis-host 0.20 or later), config and, optionally, provides (what ctx.provide provides reaches rutis without it).
  • Events are one bus across every plugin, runtime and linked node (rutis 0.13): ctx.on(name, listener) registers with the host by itself and returns a disposer; ctx.emit / parallel / serial / waterfall / bail reach listeners in any language, with the same results as in one process; ctx.filter picks listeners. On unload the row's ctx.signal is aborted and its running listeners are waited for. See events.
  • Modules resolve from the project: npm names and subpaths from its node_modules, ./paths relative to it. Install plugins with bun add.
  • Nothing is installed or read behind the host's back: the runtime always runs with --no-install (a missing package fails, it is never downloaded) and --no-env-file (the environment is what the host gives). The project's bunfig.toml applies, as the project's own configuration.
  • Synchronous calls are re-entrant: while a plugin's synchronous call into rutis waits, calls into this runtime still run, so runtimes that call each other never wait for each other for ever. A plugin's service may therefore be called while that plugin is inside a synchronous call: do not hold a lock across a call into rutis.
  • An uncaught error ends the process, and with it every service of this runtime.
  • Reloading a row imports its module again when the file changed; the modules it imports stay loaded (restart the runtime to replace those).
  • Packages installed while the runtime runs are found after the runtime restarts: a Bun process remembers that a package was missing.

Bun 1.4 or later. Besides running on the host's machine (local channels), it runs as a remote runtime: listening (listen:ws://…, listen:wss://…) or dialing a rutis access point (dial:ws://…, dial:wss://…); see the Bun plugin guide.

Embedding hosts start it with rutis_host::connect::SpawnPlugin::new("bun", rutis_host::languages::bun::launcher(…), project) (Rust).

版本与发布记录

@arcships/rutis-bun 共发布 22 个版本,首次发布于 2026/10/11;过去 12 个月发布了 22 个版本。

版本发布日期距今
0.21.0latest2026/11/061 天前
0.20.12026/11/034 天前
0.20.02026/11/025 天前
0.19.32026/10/317 天前
0.19.22026/10/308 天前
0.19.12026/10/308 天前

关于 @arcships/rutis-bun 的常见问题

@arcships/rutis-bun 是什么?

The Bun runtime of rutis: runs JavaScript and TypeScript plugins in Bun for a rutis host

如何安装 @arcships/rutis-bun?

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

@arcships/rutis-bun 支持 TypeScript 吗?

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

@arcships/rutis-bun 支持 ESM 还是 CommonJS?

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

@arcships/rutis-bun 可以商用吗?

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

@arcships/rutis-bun 的下载量有多少?

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

@arcships/rutis-bun 还在维护吗?

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