@avahq/wrtc

中文文档
0.7.6-fixondata.1发布于 2024/04/23BSD-2-ClauseTypeScriptCommonJS零依赖近 30 天下载 5216

Standards-compliant WebRTC implementation for Node

原始使用文档
文档目录4 节
  1. Install
  2. Supported Platforms
  3. Examples
  4. Build @avahq module and deploy them

    

NPM

node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M94. This project is aiming for spec-compliance and will eventually be tested using the W3C's web-platform-tests project. A number of nonstandard APIs for testing are also included.

Install

npm install @avahq/wrtc

Installing from NPM downloads a prebuilt binary for your operating system × architecture, based on optional dependency filters.

To install a debug build or cross-compile, you should build from source.

Supported Platforms

The following platforms are confirmed to work with node-webrtc and have prebuilt binaries available. Since node-webrtc targets N-API version 3, there may be additional platforms supported that are not listed here. If your platform is not supported, you may still be able to build from source.

Linux macOS Windows
x64 arm64 x64 arm64 x64
Node 18 ✓ ? ✓ ✓ ✓
20 ✓ ✓ ✓ ✓ ✓

Examples

See node-webrtc/node-webrtc-examples.

Build @avahq module and deploy them

  • first login via npm login
  • the compile the binary via dockerfile docker build -t webrtc-forked/arm64 . || docker build -t webrtc-forked/amd64 -f Dockerfile.amd64 . if needed our your personnal machine, use the target arch via TARGET_ARCH=arm64|x64 npm run build
  • It can take time to build (~15mn on mac m2)
  • Run the container image you build
  • Then get the wrtc.node from the build-${arch} folder (via docker cp or docker file dashboard) and put it inside the right prebuild/${arch} folder
  • Do it for all platform/arch you can
  • Run npm version major|minor|patch.. inside each subfolder
  • Run npm publish and wait for ok return (if e422 please add --access-public to the publish command)
  • Update the version linked for every submodules into package.json here
  • Run npm version major|minor|patch.. inside this project
  • Run npm publish inside this project
  • DONE

版本与发布记录

@avahq/wrtc 共发布 5 个版本,首次发布于 2024/04/17;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.7.6-fixondata.1latest2024/04/232 年前
0.7.6-fixondata.02024/04/182 年前
0.7.52024/04/172 年前
0.7.42024/04/172 年前
0.7.32024/04/172 年前

关于 @avahq/wrtc 的常见问题

@avahq/wrtc 是什么?

Standards-compliant WebRTC implementation for Node

如何安装 @avahq/wrtc?

在项目目录运行 npm install @avahq/wrtc,或使用 pnpm add / yarn add / bun add。

@avahq/wrtc 支持 TypeScript 吗?

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

@avahq/wrtc 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@avahq/wrtc 可以商用吗?

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

@avahq/wrtc 的下载量有多少?

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

@avahq/wrtc 还在维护吗?

最新版本 0.7.6-fixondata.1 发布于 2024/04/23(2 年前);至今共发布 5 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/04/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。