Skip to content

Please make Node.js embeddable (e.g. libnode) #52289

Open
@alshdavid

Description

@alshdavid

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 standard library 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 is not (easily) able to be used as an embedded runtime leading projects to look for solutions with incomplete support - like 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?

It would be amazing if Node.js released a libnode library that exported Node.js capabilities and enabled napi access to the host context.

Professionally, my organization has a use case that would benefit greatly from the ability to embed Node.js within a Rust based host process - however, practically, no such capability exists.

I'd assume this would be in the form of a c++ library though a Rust crate would be amazing.

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
  • Looking over the Node.js source to understand how difficult it would be to create a Rust create with bindings

Metadata

Metadata

Assignees

Labels

embeddingIssues and PRs related to embedding Node.js in another project.feature requestIssues that request new features to be added to Node.js.node-apiIssues and PRs related to the Node-API.

Type

No type

Projects

Status

Awaiting Triage

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions