I'm looking to create a native addon with Node-API (more specifically with the C++ wrapper module node-addon-api
).
I need to have global read-only data that will be loaded once and will be shared between different instances of the addon (e.g. when the addon is loaded by different node.js workers).
Is there a recommended way to do this? Would it be safe to just store the data in a static variable?