nodejs C++ shared objects

Overview:

I have a NodeJS server with a few C++ modules in it, executing one overall "job". Some objects (C++ objects, let's say "singletons") in these modules are common and their states after initialization should be shared between each module. The initialization of those objects has to be done once during server startup.

Example:

A, B - separate C++ modules which should be executed as one job

x, y, z - shared C++ objects (possibly a lot of them)

  1. Server receives a (http) request and processes it in A using x, y and z.
  2. The (http) response goes from A to the client.
  3. Server receives another (http) request and processes it in B also using x, y and z.
  4. The (http) response goes from B to the client.

Questions:

Can you tell me if there is some known best practice of initialization and sharing of these objects between all C++ modules?

What is the lifecycle of a particular C++ module in NodeJS? When are they removed from the memory?