nodejs / nodejs/node

Offer a C FFI for Node.js embedders

未关闭
#52,289 19 条评论 14 个 reaction 已指派 1 人 在 GitHub 查看

@vmoroz 已经在做这个了。

开始于 2025年4月25日。

embedding feature request never-stale node-api
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 2 小时
30 天内合并 PR
283

描述

What is the problem this feature will solve?

Node.js is prolific throughout the server-side world with many projects wanting to repackage the Node.js runtime and the associated standard library/resolution logic/Node.js-isms to offer it to customers such that they can reuse their existing tooling/dependencies.

Notable examples of this:

  • Rspack
  • Esbuild
  • Parcel
  • Supabase
  • AWS Lambda
  • etc

Currently, Node.js cannot be embedded in languages that only support native libraries with a C FFI (Rust, Dotnet, Go, etc).

This leads project maintainers to look for alternative embeddable runtimes that have incomplete Nodejs support, notably Deno (which is a great project in its own right, but lacks certain features that would necessitate consumers rewriting project code).

What is the feature you are proposing to solve the problem?
  • Expose Node.js embedding capabilities via a C FFI
  • Offer a static library to allow including Node.js within the embedding binary
What alternatives have you considered?
  • Embedding Deno
  • Removing the "Deno" parts of Deno and maintaining a light version with a focus on supporting the Node.js standard library
  • Maintaining a fork of Nodejs with a C FFI

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。