carduh carduh - 2 months ago 5
Node.js Question

Store JS Object and return him - Nodejs addon

I am only trying to build a addon that only receives any object and return them back.

Server:

var is_object = addon.return_object(previous_object);


Addon:

void return_object(const FunctionCallbackInfo<v8::Value>& args) {
Isolate* isolate = Isolate::GetCurrent();
HandleScope scope(isolate);

Local<Object> obj = Object::"From args"; //The missing part

args->GetReturnValue().Set(obj);
}

Answer

The method is:

Local<Object> obj = args[arg_value]->ToObject();
Comments