{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node-addon-api/issues/352","repository_url":"https://api.github.com/repos/nodejs/node-addon-api","labels_url":"https://api.github.com/repos/nodejs/node-addon-api/issues/352/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node-addon-api/issues/352/comments","events_url":"https://api.github.com/repos/nodejs/node-addon-api/issues/352/events","html_url":"https://github.com/nodejs/node-addon-api/issues/352","id":362258960,"node_id":"MDU6SXNzdWUzNjIyNTg5NjA=","number":352,"title":"How to handle returned C++ reference of non ObjectWrap object?","user":{"login":"BotellaA","id":3213882,"node_id":"MDQ6VXNlcjMyMTM4ODI=","avatar_url":"https://avatars1.githubusercontent.com/u/3213882?v=4","gravatar_id":"","url":"https://api.github.com/users/BotellaA","html_url":"https://github.com/BotellaA","followers_url":"https://api.github.com/users/BotellaA/followers","following_url":"https://api.github.com/users/BotellaA/following{/other_user}","gists_url":"https://api.github.com/users/BotellaA/gists{/gist_id}","starred_url":"https://api.github.com/users/BotellaA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BotellaA/subscriptions","organizations_url":"https://api.github.com/users/BotellaA/orgs","repos_url":"https://api.github.com/users/BotellaA/repos","events_url":"https://api.github.com/users/BotellaA/events{/privacy}","received_events_url":"https://api.github.com/users/BotellaA/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-20T16:07:44Z","updated_at":"2018-09-20T16:31:20Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I do not understand if there is a way to handle returned C++ reference of non ObjectWrap object.\r\nFor example: `X& some_function()` where `X` could be a `bool`, `float` or `std::string`.\r\n\r\nI could returned a `Napi::Boolean`, `Napi::Number` or `Napi::String` but I am loosing the \"reference\" part. Is there a way to returned this value and later still be able to directly modify the C++ value from the JS side?"},"comment":{"url":"https://api.github.com/repos/nodejs/node-addon-api/issues/comments/423248695","html_url":"https://github.com/nodejs/node-addon-api/issues/352#issuecomment-423248695","issue_url":"https://api.github.com/repos/nodejs/node-addon-api/issues/352","id":423248695,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzI0ODY5NQ==","user":{"login":"NickNaso","id":387506,"node_id":"MDQ6VXNlcjM4NzUwNg==","avatar_url":"https://avatars2.githubusercontent.com/u/387506?v=4","gravatar_id":"","url":"https://api.github.com/users/NickNaso","html_url":"https://github.com/NickNaso","followers_url":"https://api.github.com/users/NickNaso/followers","following_url":"https://api.github.com/users/NickNaso/following{/other_user}","gists_url":"https://api.github.com/users/NickNaso/gists{/gist_id}","starred_url":"https://api.github.com/users/NickNaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickNaso/subscriptions","organizations_url":"https://api.github.com/users/NickNaso/orgs","repos_url":"https://api.github.com/users/NickNaso/repos","events_url":"https://api.github.com/users/NickNaso/events{/privacy}","received_events_url":"https://api.github.com/users/NickNaso/received_events","type":"User","site_admin":false},"created_at":"2018-09-20T16:31:20Z","updated_at":"2018-09-20T16:31:20Z","author_association":"MEMBER","body":"Hi @BotellaA I think that you need to use `Napi::External` class [https://github.com/nodejs/node-addon-api/blob/master/doc/external.md](https://github.com/nodejs/node-addon-api/blob/master/doc/external.md) \r\nSee the test for some examples [https://github.com/nodejs/node-addon-api/blob/master/test/external.js](https://github.com/nodejs/node-addon-api/blob/master/test/external.js) and [https://github.com/nodejs/node-addon-api/blob/master/test/external.cc](https://github.com/nodejs/node-addon-api/blob/master/test/external.cc)"}}
{"actor":{"display_login":"NickNaso"}}