嵌入应用示例


🌐 Example embedding application

以下各节将概述如何使用这些 API 从零创建一个应用,该应用将执行等同于 node -e <code> 的操作,即接收一段 JavaScript 并在特定于 Node.js 的环境中运行它。

🌐 The following sections will provide an overview over how to use these APIs to create an application from scratch that will perform the equivalent of node -e <code>, i.e. that will take a piece of JavaScript and run it in a Node.js-specific environment.

完整代码可以在 在 Node.js 源代码树中 找到。

🌐 The full code can be found in the Node.js source tree.