| route-pattern | /_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format) |
| route-controller | voltron_pull_requests_fragments |
| route-action | pull_request_layout |
| fetch-nonce | v2:4ee9198b-7720-289d-8945-ff6a0b0c56d5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 88BA:122E03:3B9C75A:5147192:6972E121 |
| html-safe-nonce | e8590178c818a80a320c8537b5e1d2fe3262e385e4ec6b6d2d1b7cbeb7c9d015 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEJBOjEyMkUwMzozQjlDNzVBOjUxNDcxOTI6Njk3MkUxMjEiLCJ2aXNpdG9yX2lkIjoiNzM5ODgwMjgwNTIzOTI0MzA0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 94f20f2cf94cb999881333b1a2b23afdbb6de1fa17c83fcd9fdd6de1ca429b34 |
| hovercard-subject-tag | pull_request:623219531 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///voltron/pull_requests_fragments/pull_request_layout |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/nodejs/node-addon-examples/182/pull_request_layout |
| twitter:image | https://opengraph.githubassets.com/a383f9ea0d913f1bc4005844990bd311a2ca43dab6a3e83ab79d30c7d42d28d9/nodejs/node-addon-examples/pull/182 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a383f9ea0d913f1bc4005844990bd311a2ca43dab6a3e83ab79d30c7d42d28d9/nodejs/node-addon-examples/pull/182 |
| og:image:alt | Hi @gengjiawen,
Was hoping for some feedback -- after experimenting with node-addon-api for a few days looks like I've managed to wrap the extracted functions into C++ objects that do not requi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dkorolev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 824b30a290fe1f3775d1c3b755ace6ec71165752363f95d9255c1b87220040e4 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node-addon-examples git https://github.com/nodejs/node-addon-examples.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 7768093 |
| octolytics-dimension-repository_nwo | nodejs/node-addon-examples |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7768093 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node-addon-examples |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ef892904a22cef6ce15e4347cbf70e4cbfdc883 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#start-of-content |
|
| https://patch-diff.githubusercontent.com/ |
|
Sign in
| https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode-addon-examples%2Fpull%2F182 |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub SparkBuild and deploy intelligent apps | https://github.com/features/spark |
| GitHub ModelsManage and compare prompts | https://github.com/features/models |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| GitHub SponsorsFund open source developers | https://github.com/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/accelerator |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
|
Sign in
| https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode-addon-examples%2Fpull%2F182 |
|
Sign up
| https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fpull_requests_fragments%2Fpull_request_layout&source=header-repo&source_repo=nodejs%2Fnode-addon-examples |
| Reload | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| Reload | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| Reload | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
|
nodejs
| https://patch-diff.githubusercontent.com/nodejs |
| node-addon-examples | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
|
Notifications
| https://patch-diff.githubusercontent.com/login?return_to=%2Fnodejs%2Fnode-addon-examples |
|
Fork
602
| https://patch-diff.githubusercontent.com/login?return_to=%2Fnodejs%2Fnode-addon-examples |
|
Star
2.6k
| https://patch-diff.githubusercontent.com/login?return_to=%2Fnodejs%2Fnode-addon-examples |
|
Code
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples |
|
Issues
50
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/issues |
|
Pull requests
10
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pulls |
|
Actions
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/actions |
|
Projects
1
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/projects |
|
Security
0
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/security |
|
Insights
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pulse |
|
Code
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples |
|
Issues
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/issues |
|
Pull requests
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pulls |
|
Actions
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/actions |
|
Projects
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/projects |
|
Security
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/security |
|
Insights
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pulse |
| Sign up for GitHub
| https://patch-diff.githubusercontent.com/signup?return_to=%2Fnodejs%2Fnode-addon-examples%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://patch-diff.githubusercontent.com/login?return_to=%2Fnodejs%2Fnode-addon-examples%2Fissues%2Fnew%2Fchoose |
| Jump to bottom | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issue-comment-box |
| dkorolev | https://patch-diff.githubusercontent.com/dkorolev |
| nodejs:main | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/tree/main |
| dkorolev:cpp_thread_safe_calls | https://patch-diff.githubusercontent.com/dkorolev/node-addon-examples/tree/cpp_thread_safe_calls |
|
Wrapped Napi-extracted functions into C++ shared_ptr<>-s for easier lifetime management.
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#top |
| dkorolev | https://patch-diff.githubusercontent.com/dkorolev |
| nodejs:main | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/tree/main |
| dkorolev:cpp_thread_safe_calls | https://patch-diff.githubusercontent.com/dkorolev/node-addon-examples/tree/cpp_thread_safe_calls |
|
Conversation
9
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
|
Commits
2
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/commits |
|
Checks
0
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/checks |
|
Files changed
4
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files |
| https://github.co/hiddenchars |
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/{{ revealButtonHref }} |
|
| https://patch-diff.githubusercontent.com/dkorolev |
| dkorolev | https://patch-diff.githubusercontent.com/dkorolev |
| Apr 26, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issue-867568179 |
| @gengjiawen | https://github.com/gengjiawen |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| dkorolev | https://patch-diff.githubusercontent.com/dkorolev |
| April 26, 2021 15:44 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#commits-pushed-fd69c1c |
|
| https://patch-diff.githubusercontent.com/dkorolev |
| cp -rv thread_safe_function_counting/ thread_safe_function_counting_w… | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/commits/fd69c1ca096c130bb0a372b5186c1b3c4760abbb |
| fd69c1c | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/commits/fd69c1ca096c130bb0a372b5186c1b3c4760abbb |
|
| https://patch-diff.githubusercontent.com/dkorolev |
| Replaced addon.{js,cc} by the new code. | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/commits/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2 |
| bec0440 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/commits/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2 |
| https://patch-diff.githubusercontent.com/dkorolev |
| dkorolev | https://patch-diff.githubusercontent.com/dkorolev |
| Apr 26, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#event-4644190232 |
| https://patch-diff.githubusercontent.com/mhdawson |
| mhdawson | https://patch-diff.githubusercontent.com/mhdawson |
| May 6, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issuecomment-833879032 |
| @KevinEady | https://github.com/KevinEady |
| @gabrielschulhof | https://github.com/gabrielschulhof |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| https://patch-diff.githubusercontent.com/mhdawson |
| mhdawson | https://patch-diff.githubusercontent.com/mhdawson |
| Jun 22, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issuecomment-866255320 |
| @KevinEady | https://github.com/KevinEady |
| @gabrielschulhof | https://github.com/gabrielschulhof |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| https://patch-diff.githubusercontent.com/KevinEady |
| KevinEady | https://patch-diff.githubusercontent.com/KevinEady |
|
Jun 22, 2021
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#pullrequestreview-690031165 |
|
View reviewed changes
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2 |
| KevinEady | https://patch-diff.githubusercontent.com/KevinEady |
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#pullrequestreview-690031165 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| @dkorolev | https://github.com/dkorolev |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| thread_safe_function_counting_wrapped/node-addon-api/addon.cc | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2#diff-893f0d68888252aac14a0c36788b5be62065da12d5968442ca4f0ec7c3b75ad4 |
| KevinEady | https://patch-diff.githubusercontent.com/KevinEady |
| Jun 22, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r656607207 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Value::From | https://github.com/nodejs/node-addon-api/blob/main/doc/value.md#from |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| thread_safe_function_counting_wrapped/node-addon-api/addon.cc | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2#diff-893f0d68888252aac14a0c36788b5be62065da12d5968442ca4f0ec7c3b75ad4 |
| KevinEady | https://patch-diff.githubusercontent.com/KevinEady |
| Jun 22, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r656615249 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| dkorolev | https://patch-diff.githubusercontent.com/dkorolev |
| Jun 25, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r658606324 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| this | https://github.com/C5T/Current/blob/stable/examples/nodejs/test.js |
| this | https://github.com/C5T/Current/blob/stable/examples/nodejs_external_server/run.js |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| thread_safe_function_counting_wrapped/node-addon-api/addon.cc | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2#diff-893f0d68888252aac14a0c36788b5be62065da12d5968442ca4f0ec7c3b75ad4 |
| KevinEady | https://patch-diff.githubusercontent.com/KevinEady |
| Jun 22, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r656616979 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| dkorolev | https://patch-diff.githubusercontent.com/dkorolev |
| Jun 25, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r658607065 |
| Learn more | https://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment |
| C5T/Current#904 | https://github.com/C5T/Current/issues/904 |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| https://patch-diff.githubusercontent.com/dkorolev |
| dkorolev | https://patch-diff.githubusercontent.com/dkorolev |
|
Jun 25, 2021
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#ref-issue-929978735 |
|
We really don't recommend storing the Napi::Env. You can access it from promise_.Env()
C5T/Current#904
| https://patch-diff.githubusercontent.com/C5T/Current/issues/904 |
| https://patch-diff.githubusercontent.com/mhdawson |
| mhdawson | https://patch-diff.githubusercontent.com/mhdawson |
| Sep 3, 2021 | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issuecomment-912597598 |
| @KevinEady | https://github.com/KevinEady |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
| Sign up for free | https://patch-diff.githubusercontent.com/join?source=comment-repo |
| Sign in to comment | https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode-addon-examples%2Fpull%2F182 |
|
| https://patch-diff.githubusercontent.com/KevinEady |
|
KevinEady
| https://patch-diff.githubusercontent.com/KevinEady |
|
| https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2 |
| Please reload this page | https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182 |
|
| https://patch-diff.githubusercontent.com/dkorolev |
|
| https://patch-diff.githubusercontent.com/mhdawson |
|
| https://patch-diff.githubusercontent.com/KevinEady |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |