IssueRaiser

Feature Request: Embedding Bun within other native applications (like a Rust program)

### What is the problem this feature would solve? Many native projects would like to be able to embed a JavaScript runtime that can leverage the Nodejs ecosystem and Nodejs standard library. - AWS Lambda - Supabase - Bundlers (Parcel, Rspack, etc) - Mongo - Applications that want to use JavaScript for plugins (like Lapce) - etc ### What is the feature you are proposing to solve the problem? Offer a dynamic C library or static C library that allows Bun to be embedded within another native application ### What alternatives have you considered? - [Nodejs Embedding API ](https://nodejs.org/docs/latest/api/embedding.html) - Very difficult to use, many projects try to use this and drop it - [Deno](https://github.com/denoland/deno/tree/main/cli) - Embedding Deno is reasonably easy to get started with however using the Nodejs standard library is not easy. - Deno requires you to fork the Deno CLI to extract support for the Nodejs API. - UPDATE: Deno has release [deno_lib](https://crates.io/crates/deno_lib) which is a crate that exposes the deno cli as a library - ~due to differences between Deno and Nodejs, certain features (like workspaces support) do not work as expected.~ - Deno does not support workers with injected snapshot libs

Posted by alshdavid on Jun 20, 2024, 10:50 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,000 issues0 comments

ux (Software)

Feature Request: Embedding Bun within other native applications (like a Rust program)

alshdavidJun 20, 2024, 10:50 PM

### What is the problem this feature would solve? Many native projects would like to be able to embed a JavaScript runtime that can leverage the Nodejs ecosystem and Nodejs standard library. - AWS Lambda - Supabase - Bundlers (Parcel, Rspack, etc) - Mongo - Applications that want to use JavaScript for plugins (like Lapce) - etc ### What is the feature you are proposing to solve the problem? Offer a dynamic C library or static C library that allows Bun to be embedded within another native application ### What alternatives have you considered? - [Nodejs Embedding API ](https://nodejs.org/docs/latest/api/embedding.html) - Very difficult to use, many projects try to use this and drop it - [Deno](https://github.com/denoland/deno/tree/main/cli) - Embedding Deno is reasonably easy to get started with however using the Nodejs standard library is not easy. - Deno requires you to fork the Deno CLI to extract support for the Nodejs API. - UPDATE: Deno has release [deno_lib](https://crates.io/crates/deno_lib) which is a crate that exposes the deno cli as a library - ~due to differences between Deno and Nodejs, certain features (like workspaces support) do not work as expected.~ - Deno does not support workers with injected snapshot libs

Comments (0)

No comments yet. Start the discussion.

Comment on this issue