@deltachat/stdio-rpc-server

中文文档
2.69.0发布于 2026/11/10MPL-2.0TypeScriptES Module零依赖构建来源已验证近 30 天下载 1.5万

This is the successor of deltachat-node, it does not use NAPI bindings but instead uses stdio executables to let you talk to core over jsonrpc over stdio. This simplifies cross-compilation and even reduces binary size (no CFFI layer and no NAPI layer).

原始使用文档
文档目录7 节
  1. npm package for deltachat-rpc-server
  2. Usage
  3. How to use on an unsupported platform
  4. How does it work when you install it
  5. How do you built this package in CI
  6. How to build a version you can use locally on your host mac…
  7. Thanks to nlnet

npm package for deltachat-rpc-server

This is the successor of deltachat-node, it does not use NAPI bindings but instead uses stdio executables to let you talk to core over jsonrpc over stdio. This simplifies cross-compilation and even reduces binary size (no CFFI layer and no NAPI layer).

Usage

The minimum nodejs version for this package is 16

npm i @deltachat/stdio-rpc-server @deltachat/jsonrpc-client
import { startDeltaChat } from "@deltachat/stdio-rpc-server";
import { C } from "@deltachat/jsonrpc-client";

async function main() {
    const dc = startDeltaChat("deltachat-data");
    console.log(await dc.rpc.getSystemInfo());
    dc.close()
}
main()

For a more complete example refer to https://github.com/deltachat-bot/echo/pull/69/files (TODO change link when pr is merged).

How to use on an unsupported platform

How does it work when you install it

NPM automatically installs platform dependent optional dependencies when os and cpu fields are set correctly.

references:

When you import this package it searches for the rpc server in the following locations and order:

  1. DELTA_CHAT_RPC_SERVER environment variable
  2. use the PATH when {takeVersionFromPATH: true} is supplied in the options.
  3. prebuilds in npm packages

so by default it uses the prebuilds.

How do you built this package in CI

  • To build platform packages, run the build_platform_package.py script:
    python3 build_platform_package.py <cargo-target>
    # example
    python3 build_platform_package.py x86_64-apple-darwin
    
  • Then pass it as an artifact to the last CI action that publishes the main package.
  • upload all packages from deltachat-rpc-server/npm-package/platform_package.
  • then publish deltachat-rpc-server/npm-package,
    • this will run update_optional_dependencies_and_version.js (in the prepack script), which puts all platform packages into optionalDependencies and updates the version in package.json

How to build a version you can use locally on your host machine for development

You can not install the npm packet from the previous section locally, unless you have a local npm registry set up where you upload it too. This is why we have separate scripts for making it work for local installation.

  • If you just need your host platform run python scripts/make_local_dev_version.py
  • note: this clears the platform_package folder
  • (advanced) If you need more than one platform for local install you can just run node scripts/update_optional_dependencies_and_version.js after building multiple platforms with build_platform_package.py

Thanks to nlnet

The initial work on this package was funded by nlnet as part of the Delta Tauri Project.

版本与发布记录

@deltachat/stdio-rpc-server 共发布 142 个版本,首次发布于 2024/05/10;过去 12 个月发布了 41 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.69.0latest2026/11/101 天前
2.68.02026/11/056 天前
2.67.02026/11/039 天前
2.66.02026/10/2914 天前
2.65.02026/10/2320 天前
2.64.02026/10/2022 天前

关于 @deltachat/stdio-rpc-server 的常见问题

@deltachat/stdio-rpc-server 是什么?

This is the successor of deltachat-node, it does not use NAPI bindings but instead uses stdio executables to let you talk to core over jsonrpc over stdio. This simplifies cross-compilation and even reduces binary size (no CFFI layer and no NAPI layer).

如何安装 @deltachat/stdio-rpc-server?

在项目目录运行 npm install @deltachat/stdio-rpc-server,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@deltachat/jsonrpc-client(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@deltachat/stdio-rpc-server 支持 TypeScript 吗?

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

@deltachat/stdio-rpc-server 支持 ESM 还是 CommonJS?

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

@deltachat/stdio-rpc-server 可以商用吗?

@deltachat/stdio-rpc-server 使用 MPL-2.0 许可。弱 Copyleft:可以商用,也可以和闭源代码一起使用;但如果分发时修改了 MPL 授权的文件,这些文件的修改需以 MPL 开源。以上为概括,不构成法律意见,请以许可原文为准。

@deltachat/stdio-rpc-server 的下载量有多少?

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

@deltachat/stdio-rpc-server 还在维护吗?

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