I am writing a Node addon in (mostly) C++ that needs to copy a NAPI::Value instance from a child process to the parent process. I need to know how to do this. Looking at the NAPI source code I see that the Value class has two fields of types napi_env and napi_value. I also see that these are pointers, so I understand that more than just these two fields must be copied to the parent thread.
Any suggestions on how to go about sending the NAPI::Value instance from the child to parent are appreciated.
You can use https://nodejs.org/api/v8.html#v8_serialization_api or JSON. In either case you will have to call JS functions from c++, there's no native API for this.