From 19bcf2cd29797ebeef0649177b283a4651ba8a07 Mon Sep 17 00:00:00 2001 From: Fenglin Li Date: Mon, 25 Jul 2022 20:59:59 +0800 Subject: [PATCH 1/4] Mention emnapi in documentation --- .../Interacting-with-code.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst index 6049992bed1e..2c5bc4dcac24 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst @@ -17,6 +17,7 @@ JavaScript and compiled C or C++: created with: - :ref:`Embind or WebIDL-Binder` + - :ref:`Emnapi (Node-API)` - Call JavaScript functions from **C/C++**: @@ -798,6 +799,16 @@ for defining the binding: of one tool over the other will usually be based on which is the most natural fit for the project and its build system. +.. _interacting-with-code-emnapi: + +Binding C/C++ and JavaScript — Emnapi (Node-API for Emscripten) +=============================================================== + +`Emnapi`_ is an unofficial `Node-API`_ implementation for Emscripten. +If you prefer Node-API, or you would like to port your Node.js addon +written in Node-API to WebAssembly, you can give it a try. See +`Emnapi documentation`_ for more details. + .. _library.js: https://github.com/emscripten-core/emscripten/blob/main/src/library.js .. _test_js_libraries: https://github.com/emscripten-core/emscripten/blob/1.29.12/tests/test_core.py#L5043 .. _src/deps_info.json: https://github.com/emscripten-core/emscripten/blob/main/src/deps_info.json @@ -808,3 +819,6 @@ for defining the binding: .. _tests/test_core.py: https://github.com/emscripten-core/emscripten/blob/1.29.12/tests/test_core.py#L4597 .. _Box2D: https://github.com/kripken/box2d.js/#box2djs .. _Bullet: https://github.com/kripken/ammo.js/#ammojs +.. _Emnapi: https://github.com/toyobayashi/emnapi +.. _Node-API: https://nodejs.org/dist/latest-v16.x/docs/api/n-api.html +.. _Emnapi documentation: https://emnapi-docs.vercel.app/guide/getting-started.html From 1b11d5ae26f6c1f1af49ea60fe8cfdbee6ef8331 Mon Sep 17 00:00:00 2001 From: toyobayashi Date: Fri, 10 Feb 2023 11:38:17 +0800 Subject: [PATCH 2/4] Mention emnapi in documentation --- .../Interacting-with-code.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst index 2c5bc4dcac24..22fffab3e085 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst @@ -801,12 +801,12 @@ for defining the binding: .. _interacting-with-code-emnapi: -Binding C/C++ and JavaScript — Emnapi (Node-API for Emscripten) +Binding C/C++ and JavaScript - Emnapi =============================================================== -`Emnapi`_ is an unofficial `Node-API`_ implementation for Emscripten. -If you prefer Node-API, or you would like to port your Node.js addon -written in Node-API to WebAssembly, you can give it a try. See +`Emnapi`_ is an unofficial `Node-API`_ implementation which can be used +in Emscripten. If you would like to port existing Node-API addon +to WebAssembly, you can give it a try. See `Emnapi documentation`_ for more details. .. _library.js: https://github.com/emscripten-core/emscripten/blob/main/src/library.js @@ -820,5 +820,5 @@ written in Node-API to WebAssembly, you can give it a try. See .. _Box2D: https://github.com/kripken/box2d.js/#box2djs .. _Bullet: https://github.com/kripken/ammo.js/#ammojs .. _Emnapi: https://github.com/toyobayashi/emnapi -.. _Node-API: https://nodejs.org/dist/latest-v16.x/docs/api/n-api.html +.. _Node-API: https://nodejs.org/dist/latest/docs/api/n-api.html .. _Emnapi documentation: https://emnapi-docs.vercel.app/guide/getting-started.html From e354bf5e119eb6759b6be4d7f7526b934b786b3c Mon Sep 17 00:00:00 2001 From: toyobayashi Date: Fri, 17 Feb 2023 14:34:21 +0800 Subject: [PATCH 3/4] Update documentation --- .../Interacting-with-code.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst index 22fffab3e085..a6e0070ee109 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst @@ -801,13 +801,13 @@ for defining the binding: .. _interacting-with-code-emnapi: -Binding C/C++ and JavaScript - Emnapi +Binding C/C++ and JavaScript - Node-API =============================================================== `Emnapi`_ is an unofficial `Node-API`_ implementation which can be used -in Emscripten. If you would like to port existing Node-API addon -to WebAssembly, you can give it a try. See -`Emnapi documentation`_ for more details. +on Emscripten. If you would like to port existing Node-API addon to WebAssembly +or compile the same binding code to both Node.js native addon and WebAssembly, +you can give it a try. See `Emnapi documentation`_ for more details. .. _library.js: https://github.com/emscripten-core/emscripten/blob/main/src/library.js .. _test_js_libraries: https://github.com/emscripten-core/emscripten/blob/1.29.12/tests/test_core.py#L5043 From b184bba1a1659663f2b43ced964b33b7710c3cb0 Mon Sep 17 00:00:00 2001 From: Toyo Li Date: Wed, 22 Feb 2023 08:59:47 +0800 Subject: [PATCH 4/4] Update Interacting-with-code.rst --- .../connecting_cpp_and_javascript/Interacting-with-code.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst index a6e0070ee109..107064dd2174 100644 --- a/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst +++ b/site/source/docs/porting/connecting_cpp_and_javascript/Interacting-with-code.rst @@ -17,7 +17,6 @@ JavaScript and compiled C or C++: created with: - :ref:`Embind or WebIDL-Binder` - - :ref:`Emnapi (Node-API)` - Call JavaScript functions from **C/C++**: