<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <h1 id="zoo-project-gsoc-2022-final-report-by-mmomtchev"
      style="color: rgb(0, 0, 0); font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; orphans: 2;
      text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; widows: 2; word-spacing: 0px;
      -webkit-text-stroke-width: 0px; text-decoration-thickness:
      initial; text-decoration-style: initial; text-decoration-color:
      initial;"><br>
    </h1>
    <p><font color="#000000">(this report is available online at
<a class="moz-txt-link-freetext" href="https://github.com/mmomtchev/mmomtchev/blob/master/GSoC-2022/ZOO-Project-mmomtchev-GSoC-2022-Final-Report.md">https://github.com/mmomtchev/mmomtchev/blob/master/GSoC-2022/ZOO-Project-mmomtchev-GSoC-2022-Final-Report.md</a>)</font><br>
    </p>
    <p><br>
    </p>
    <h1 id="zoo-project-gsoc-2022-final-report-by-mmomtchev"
      style="font-family: "Times New Roman"; font-style:
      normal; font-variant-ligatures: normal; font-variant-caps: normal;
      letter-spacing: normal; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; word-spacing: 0px;
      -webkit-text-stroke-width: 0px; text-decoration-thickness:
      initial; text-decoration-style: initial; text-decoration-color:
      initial; color: rgb(0, 0, 0);">ZOO-Project GSoC 2022 Final Report
      by @mmomtchev</h1>
    <h3
id="adding-node-js-support-for-service-implementation-to-be-run-from-the-zoo-kernel"
      style="font-family: "Times New Roman"; font-style:
      normal; font-variant-ligatures: normal; font-variant-caps: normal;
      letter-spacing: normal; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; word-spacing: 0px;
      -webkit-text-stroke-width: 0px; text-decoration-thickness:
      initial; text-decoration-style: initial; text-decoration-color:
      initial; color: rgb(0, 0, 0);">Adding Node.js support for service
      implementation to be run from the ZOO-Kernel</h3>
    <h2 id="abstract" style="font-family: "Times New Roman";
      font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Abstract</h2>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      ZOO-Project is a solid WPS server able to handle services
      implemented in various different programming languages. The
      existing<span> </span><code>ZOO-Kernel</code><span> </span>supports
      C, C++, and JS implementations with the SpiderMonkey engine. With
      this project, the objective was to add support for NodeJS
      implementation in the<span> </span><code>ZOO-Kernel</code>.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Mentors:
      Gérald Fenoy, Aditi Sawant, Rajat Shinde</p>
    <h2 id="state-of-the-art" style="font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">State
      of the art</h2>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">SpiderMonkey,
      the original JavaScript engine, has a very mature support for
      being integrated in C++ projects as a shared library.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Node.js
      already supports being built as a shared library instead of an
      executable. The main user and current maintainer of this feature
      is the Electron project (<a href="https://www.electronjs.org/"
        class="moz-txt-link-freetext">https://www.electronjs.org/</a>).
      Electron wraps around Node.js in a rather complex manner,
      reimplementing some its features. It does so by directly accessing
      the Node.js internals and the raw V8 API, by directly linking to
      it.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Ubuntu
      and Debian already provide Node.js and libnode packages. These are
      however built according to those distributions' guidelines and are
      not updated once the distribution is released. As Node.js is a
      very fast moving project, most users use the binaries provided by
      NodeSource, which are maintained by developers directly linked to
      the Node.js team. These are widely considered to be the reference
      binaries for each platform. The notion of a reference binary
      exists because Node.js supports native add-ons which are not
      always compatible between different Node.js builds. The libnode
      packages in those distributions do not allow access to the Node.js
      internals so these are in fact next to useless. NodeSource, on the
      other hand, does not provide prebuilt libnode packages.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><img
src="https://raw.githubusercontent.com/mmomtchev/mmomtchev/master/GSoC-2022/libnode-before.png"
        alt="Current libnode"></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><em>(The
        current state of libnode)</em></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">An
      issue, with 14 hearts, on the Node.js tracker, proposes an
      alternative libnode API, built upon the binary stable N-API used
      for native addons:<span> </span><a
        href="https://github.com/nodejs/node/issues/23265"
        class="moz-txt-link-freetext">https://github.com/nodejs/node/issues/23265</a>.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><img
src="https://raw.githubusercontent.com/mmomtchev/mmomtchev/master/GSoC-2022/native-addon.png"
        alt="Current N-API"></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><em>(An
        overview of the excellent and very successful<span> </span><code>N-API</code><span> </span>and<span> </span><code>node-addon-api</code>)</em></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Very
      early in this project, it became clear that instead of developing
      the ZOO-Project support around a very specific Node.js/V8 version,
      that was to be included in the source distribution, it was much
      more future proof to develop an abstraction layer, and then, in
      the spirit of the GSoC program, to contribute it back to the open
      source community.</p>
    <h2 id="n-api-embedding" style="font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">N-API
      Embedding</h2>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Node.js
      provides an excellent stable ABI for creating native addons. It is
      a second-generation API - replacing the previous NAN (<em>Native
        Abstractions for Node.js</em>) - and it is the result of the
      very significant experience of the Node.js developers in the field
      of distributing binary addons for a JavaScript runtime. It allows
      a third party to compile and then to distribute a single binary
      per supported platform that will be compatible with all future
      Node.js versions. This magic takes place behind the scenes and
      allows the average user to simply type<span> </span><code>npm
        install pkg</code><span> </span>and to retrieve binary code, in
      addition to the JS library, that will simply work on its platform.
      The ABI has even full C++ support that avoids any compiler runtime
      conflicts by being entirely implemented as C++ templates to be
      built with the addon. These templates reduce the C++ API to plain
      C calls using N-API across the linking border of the shared
      library for maximum compatibility. This C++ API is called<span> </span><code>node-addon-api</code><span> </span>and
      it is a separate project from Node.js itself.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">This
      ABI provides stable abstractions for calling and being called from
      JS code, decoding JS objects and interacting with the garbage
      collector and the different worker threads (V8 isolates) which are
      not transparent from the viewpoint of the C++ code. V8 isolates
      are represented by an opaque reference, called a Node.js
      environment, that is passed to every N-API method. It is this
      reference to a Node.js environment that is used to provide an
      alternative implementation that allows speaking to an embedded
      Node.js instance instead of the calling Node.js instance.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><img
src="https://raw.githubusercontent.com/mmomtchev/mmomtchev/master/GSoC-2022/libnode-after.png"
        alt="New libnode"></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><em>(Turning<span> </span><code>N-API</code><span> </span>and<span> </span><code>node-addon-api</code><span> </span>inside-out)</em></p>
    <h3 id="the-platform-environment" style="font-family: "Times
      New Roman"; font-style: normal; font-variant-ligatures:
      normal; font-variant-caps: normal; letter-spacing: normal;
      text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      Platform Environment</h3>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      first major element of this libnode implementation is a new
      environment type compatible with all the existing methods. This
      includes N-API primitives for creation of a new environment that
      take care of loading Node.js and V8 and initializing it:</p>
    <pre style="font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><code class="lang-c"><span class="hljs-function">napi_status <span class="hljs-title">napi_create_platform</span><span class="hljs-params">(<span class="hljs-keyword">int</span> argc,
                                    <span class="hljs-keyword">char</span>** argv,
                                    <span class="hljs-keyword">int</span> exec_argc,
                                    <span class="hljs-keyword">char</span>** exec_argv,
                                    <span class="hljs-keyword">char</span>*** errors,
                                    <span class="hljs-keyword">int</span> thread_pool_size,
                                    napi_platform* result)</span></span>;

<span class="hljs-function">napi_status <span class="hljs-title">napi_create_environment</span><span class="hljs-params">(napi_platform platform,
                                    <span class="hljs-keyword">char</span>*** errors,
                                    <span class="hljs-keyword">const</span> <span class="hljs-keyword">char</span>* main_script,
                                    napi_env* result)</span></span>;

<span class="hljs-function">napi_status <span class="hljs-title">napi_destroy_platform</span><span class="hljs-params">(napi_platform platform, <span class="hljs-keyword">int</span> *exit_code)</span></span>;

<span class="hljs-function">napi_status <span class="hljs-title">napi_destroy_environment</span><span class="hljs-params">(napi_env env)</span></span>;
</code></pre>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">These
      methods allow the creation of a<span> </span><code>napi_env</code><span> </span>object
      - the same type of object used by Node.js to interact with a
      native C/C++ addon. It describes a running V8 isolate with Node.js
      builtins.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      C++ classes<span> </span><code>Napi::Platform</code><span> </span>and<span> </span><code>Napi::PlatformEnv</code>,
      implemented in<span> </span><code>node-addon-api</code><span> </span>allow
      for a cleaner interface when using only C++.</p>
    <h3 id="the-asynchronous-execution-model" style="font-family:
      "Times New Roman"; font-style: normal;
      font-variant-ligatures: normal; font-variant-caps: normal;
      letter-spacing: normal; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; word-spacing: 0px;
      -webkit-text-stroke-width: 0px; text-decoration-thickness:
      initial; text-decoration-style: initial; text-decoration-color:
      initial; color: rgb(0, 0, 0);">The Asynchronous Execution Model</h3>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Node.js
      has a very peculiar asynchronous execution model that comes from
      the Web legacy of JavaScript. This is something that must be taken
      into account when embedding JavaScript code - as it expects its
      functions to be run as callbacks from the event loop.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">In
      order to provide clean and simple interface for calling C/C++
      programs, that event loop has been completely abstracted.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">For
      example, consider this simple JS function:</p>
    <pre style="font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><code class="lang-js"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">fn</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">const</span> r = { <span class="hljs-attr">result</span>: <span class="hljs-string">'pending'</span> };
    setImmediate(<span class="hljs-function"><span class="hljs-params">()</span> =></span> {
        r.result = <span class="hljs-string">'result'</span>;
    });
    <span class="hljs-keyword">return</span> r;
}
</code></pre>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">It
      returns an object with an attribute and then schedules a coroutine
      to modify this object that will run at some later point. When this
      function is called from C++, the calling program will need a
      method to trigger the execution of this coroutine which will still
      be pending at the moment the function returns.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Two
      methods allow flushing of the pending callbacks:</p>
    <pre style="font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><code class="lang-c">napi_status napi_run_environment(<span class="hljs-name">napi_env</span> env)<span class="hljs-comment">;</span>

napi_status napi_await_promise(<span class="hljs-name">napi_env</span> env,
                            napi_value promise,
                            napi_value *result);
</code></pre>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      first one spins the event loop until all pending callbacks have
      been executed, the second one spins it until the passed<span> </span><code>Promise</code><span> </span>object
      has been resolved (or rejected) and retrieves its value (or
      error). These functions allow the execution of the pending
      JavaScript code in the context of the currently running C++
      thread.</p>
    <h3 id="-require-import-" style="font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><code>require</code>/<code>import</code></h3>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">At
      the time when SpiderMonkey was still the leading JS engine, JS did
      not really had the notion of packages or code splitting. It is
      Node.js that introduced the<span> </span><code>require</code><span> </span>method
      for loading of external JS code.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">In
      order to provide a true sense of<span> </span><em>linking</em><span> </span>the
      JS code from C/C++, it was decided to support directly calling<span> </span><code>require</code><span> </span>and<span> </span><code>import</code><span> </span>methods
      from C/C++ - as this would be the way that JS code would load a
      package. These methods - the traditional Node.js<span> </span><code>require</code><span> </span>and
      the new dynamic function-like<span> </span><code>import</code><span> </span>(the
      static<span> </span><code>import</code><span> </span>is part of
      the language) are in fact implemented as Node.js builtins and are
      loaded during the boostrapping of the JS code.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">In
      order to render them accessible, a new bootstrapping was
      implemented - one that exported these methods in the<span> </span><code>global</code><span> </span>object
      so that they can easily be accessed from C/C++.</p>
    <h3 id="ppa-packages" style="font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">PPA
      Packages</h3>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">In
      order for the<span> </span><code>libnode</code><span> </span>to be
      an (almost) drop-in replacement for the SpiderMonkey, Ubuntu PPA
      packages are provided as this is the way that ZOO-Project used to
      retrieve and include SpiderMonkey - by using the now obsolete
      packages<span> </span><code>libmoz</code>.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">These
      packages are currently provided only for Ubuntu LTS versions -
      Bionic (18.04), Focal (20.04) and Jammy (22.04) and they exist
      both for the Node.js 16.x (LTS) and 18.x (Current) branches:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
        href="https://launchpad.net/~mmomtchev"
        class="moz-txt-link-freetext">https://launchpad.net/~mmomtchev</a></p>
    <ul style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">
      <li><code>ppa:mmomtchev/libnode</code></li>
      <li><code>ppa:mmomtchev/libnode-18.x</code></li>
    </ul>
    <h3 id="multi-threading" style="font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Multi-threading</h3>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">In
      order to simplify the API and to avoid any V8 locking issues,
      there is one very simple rule that is to be followed:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><strong>After
        creating a new platform environment, only the thread that
        created it is allowed to access it.</strong></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">This
      greatly simplifies the code and does not seem to impose any
      significant additional restrictions.</p>
    <h2 id="future-of-n-api-embedding" style="font-family: "Times
      New Roman"; font-style: normal; font-variant-ligatures:
      normal; font-variant-caps: normal; letter-spacing: normal;
      text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Future
      of N-API Embedding</h2>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Embedding
      JS plugins in C/C++ software is a very common need. JS is
      currently the fastest growing general purpose language in the
      world and it is the first language for many young developers.
      C/C++ on the other hand still has the largest installed base and
      it is not going away for at least several more generations. Even
      if it is likely to be challenged in this role during the coming
      decade, it is still the first language for implementing complex
      system software such as operating systems, database engines,
      network processing or interpreting higher-level languages such as
      JS or Python.</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">N-API
      embedding<span> </span><code>libnode</code><span> </span>has a
      very great potential because it allows for very easy support of
      Node.js plugins.</p>
    <h3 id="short-term-plans" style="font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Short-term
      Plans</h3>
    <ul style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">
      <li>
        <p>Provide Debian packages</p>
      </li>
      <li>
        <p>Provide macOS and Windows binaries</p>
      </li>
    </ul>
    <h3 id="long-term-plans" style="font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Long-term
      Plans</h3>
    <ul style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">
      <li>
        <p>Push forward with the merging of the PR<span> </span><a
            href="https://github.com/nodejs/node/pull/43542"
            class="moz-txt-link-freetext">https://github.com/nodejs/node/pull/43542</a><span> </span>in
          the main Node.js tree</p>
        <p>The whole point of N-API embedding, besides being easier for
          the end-user, is that it is binary compatible with future
          Node.js versions. In order for<span> </span><code>libnode</code><span> </span>to
          be truly future-proof, it has to be merged at some point with
          the main Node.js tree.</p>
        <p>Besides the sheer amount of work and testing required for
          merging a large PR in a project of Node.js' stature, there is
          one particularly problematic point -<span> </span><code>libnode</code><span> </span>currently
          carries a monkey-patch for<span> </span><code>libuv</code><span> </span>that
          fixes a complex issue that never happens with the use that
          Node.js makes of it:<span> </span><a
            href="https://github.com/libuv/libuv/issues/3686"
            class="moz-txt-link-freetext">https://github.com/libuv/libuv/issues/3686</a>.
          This means that merging<span> </span><code>libnode</code><span> </span>will
          require simultaneous pushes to both Node.js and libuv and an
          upgrade of the libuv version in Node.js.</p>
        <p>In order to mitigate risks when it comes to ZOO-Project,
          Node.js support in ZOO-Project has been implemented without
          using the very practical shortcut<span> </span><code>napi_await_promise</code><span> </span>which
          requires modifying<span> </span><code>libuv</code>.</p>
      </li>
    </ul>
    <h2 id="documentation" style="font-family: "Times New
      Roman"; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Documentation</h2>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><img
src="https://raw.githubusercontent.com/mmomtchev/mmomtchev/master/GSoC-2022/gsoc-2022.png"
        alt="illustration"></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><em>(An
        example for calling<span> </span><code>axios.get</code><span> </span>from
        C++)</em></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><strong>The
        program resulting from compiling this code will be a very small
        binary executable, that will be dynamically linked with the 80Mb
        (on Linux)<span> </span><code>libnode.so</code><span> </span>shared
        library and it will require the presence of a<span> </span><code>node_modules/axios</code><span> </span>and
        all of its dependencies in the same directory as the executable.</strong></p>
    <h3 id="using-libnode-to-implement-support-of-js-plugins-in-c-code"
      style="font-family: "Times New Roman"; font-style:
      normal; font-variant-ligatures: normal; font-variant-caps: normal;
      letter-spacing: normal; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; word-spacing: 0px;
      -webkit-text-stroke-width: 0px; text-decoration-thickness:
      initial; text-decoration-style: initial; text-decoration-color:
      initial; color: rgb(0, 0, 0);">Using<span> </span><code>libnode</code><span> </span>to
      implement support of JS plugins in C++ code</h3>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      full documentation for using N-API embedding<span> </span><code>libnode</code><span> </span>has
      been integrated in the Node.js documentation in the<span> </span><code>napi-libnode</code><span> </span>branch:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
href="https://github.com/mmomtchev/node/blob/napi-libnode/doc/api/embedding.md"
        class="moz-txt-link-freetext">https://github.com/mmomtchev/node/blob/napi-libnode/doc/api/embedding.md</a><span> </span><a
href="https://github.com/mmomtchev/node/blob/napi-libnode/doc/api/n-api.md"
        class="moz-txt-link-freetext">https://github.com/mmomtchev/node/blob/napi-libnode/doc/api/n-api.md</a></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">Also,
      the<span> </span><code>libnode</code><span> </span>repository
      contains some examples allowing to quick-start a new project:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
        href="https://github.com/mmomtchev/libnode/tree/main/examples"
        class="moz-txt-link-freetext">https://github.com/mmomtchev/libnode/tree/main/examples</a></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">One
      should probably start by the<span> </span><strong><em>Calling<span> </span><code>axios</code><span> </span>from
          C++</em></strong><span> </span>example:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
href="https://github.com/mmomtchev/libnode/blob/main/examples/axios-example.cc"
        class="moz-txt-link-freetext">https://github.com/mmomtchev/libnode/blob/main/examples/axios-example.cc</a></p>
    <h3
      id="using-node-js-javascript-to-implement-a-wps-service-in-zoo-project"
      style="font-family: "Times New Roman"; font-style:
      normal; font-variant-ligatures: normal; font-variant-caps: normal;
      letter-spacing: normal; text-align: start; text-indent: 0px;
      text-transform: none; white-space: normal; word-spacing: 0px;
      -webkit-text-stroke-width: 0px; text-decoration-thickness:
      initial; text-decoration-style: initial; text-decoration-color:
      initial; color: rgb(0, 0, 0);">Using Node.js JavaScript to
      implement a WPS service in ZOO-Project</h3>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      documentation geared towards WPS service authors has been
      integrated in the ZOO-Project documentation and it is available in<span> </span><code>nodejs</code><span> </span>branch:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
href="https://github.com/mmomtchev/ZOO-Project/blob/nodejs/docs/services/howtos.rst#javascript-node-js"
        class="moz-txt-link-freetext">https://github.com/mmomtchev/ZOO-Project/blob/nodejs/docs/services/howtos.rst#javascript-node-js</a></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">An
      example Node.js service is available as PR for the examples
      repository of ZOO-Project:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
        href="https://github.com/ZOO-Project/examples/pull/1"
        class="moz-txt-link-freetext">https://github.com/ZOO-Project/examples/pull/1</a></p>
    <h2 id="the-code" style="font-family: "Times New Roman";
      font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; letter-spacing: normal; text-align:
      start; text-indent: 0px; text-transform: none; white-space:
      normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;
      text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      Code</h2>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">All
      the work done in Node.js is available in my Node.js forks:</p>
    <ul style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">
      <li>v16.x branch<span> </span><a
          href="https://github.com/mmomtchev/node/tree/napi-libnode-v16.x"
          class="moz-txt-link-freetext">https://github.com/mmomtchev/node/tree/napi-libnode-v16.x</a></li>
      <li>v18.x branch<span> </span><a
          href="https://github.com/mmomtchev/node/tree/napi-libnode-v18.x"
          class="moz-txt-link-freetext">https://github.com/mmomtchev/node/tree/napi-libnode-v18.x</a></li>
      <li>main branch<span> </span><a
          href="https://github.com/mmomtchev/node/tree/napi-libnode"
          class="moz-txt-link-freetext">https://github.com/mmomtchev/node/tree/napi-libnode</a></li>
    </ul>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      PR for merging N-API embedding to the main branch of Node.js:<span> </span><a
        href="https://github.com/nodejs/node/pull/43542"
        class="moz-txt-link-freetext">https://github.com/nodejs/node/pull/43542</a></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">(currently
      unmergeable until libuv is modified accordingly)</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      Ubuntu PPA packages build system, along with instructions for
      installing and using<span> </span><code>libnode</code><span> </span>are
      available in a dedicated repo:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
        href="https://github.com/mmomtchev/libnode"
        class="moz-txt-link-freetext">https://github.com/mmomtchev/libnode</a></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">All
      the work done in ZOO-Project itself is available in the<span> </span><code>nodejs</code><span> </span>branch:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
        href="https://github.com/mmomtchev/ZOO-Project/tree/nodejs"
        class="moz-txt-link-freetext">https://github.com/mmomtchev/ZOO-Project/tree/nodejs</a></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      currently pending PR is available here:</p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);"><a
        href="https://github.com/ZOO-Project/ZOO-Project/pull/30"
        class="moz-txt-link-freetext">https://github.com/ZOO-Project/ZOO-Project/pull/30</a></p>
    <p style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">The
      slides from the<span> </span><code>libnode</code><span> </span>presentation
      at<span> </span><a href="https://2022.foss4g.org/">FOSS4G 2022</a><span> </span>can
      be found here:</p>
    <ul style="font-family: "Times New Roman"; font-size:
      medium; font-style: normal; font-variant-ligatures: normal;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; text-align: start; text-indent: 0px; text-transform: none;
      white-space: normal; word-spacing: 0px; -webkit-text-stroke-width:
      0px; text-decoration-thickness: initial; text-decoration-style:
      initial; text-decoration-color: initial; color: rgb(0, 0, 0);">
      <li>(sources)<span> </span><a
href="https://github.com/mmomtchev/zoo-slides/blob/gsoc2022-nodejs/FOSS4G-2022/GSoC/Node.js/index.html"
          class="moz-txt-link-freetext">https://github.com/mmomtchev/zoo-slides/blob/gsoc2022-nodejs/FOSS4G-2022/GSoC/Node.js/index.html</a></li>
      <li>(preview)<span> </span><a
href="https://htmlpreview.github.io/?https://github.com/mmomtchev/zoo-slides/blob/gsoc2022-nodejs/FOSS4G-2022/GSoC/Node.js/index.html#/"
          class="moz-txt-link-freetext">https://htmlpreview.github.io/?https://github.com/mmomtchev/zoo-slides/blob/gsoc2022-nodejs/FOSS4G-2022/GSoC/Node.js/index.html#/</a></li>
    </ul>
    <p><span class="moz-txt-tag">-- <br>
      </span>Cordialement,
      <br>
      Momtchil Momtchev <a class="moz-txt-link-rfc2396E"
        href="mailto:momtchil@momtchev.com"><momtchil@momtchev.com></a></p>
  </body>
</html>