carduh carduh - 10 months ago 64
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.


var is_object = addon.return_object(previous_object);


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

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


Answer Source

The method is:

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