René's URL Explorer Experiment


Title: Wrapped Napi-extracted functions into C++ `shared_ptr<>`-s for easier lifetime management. by dkorolev · Pull Request #182 · nodejs/node-addon-examples · GitHub

Open Graph Title: Wrapped Napi-extracted functions into C++ `shared_ptr<>`-s for easier lifetime management. by dkorolev · Pull Request #182 · nodejs/node-addon-examples

X Title: Wrapped Napi-extracted functions into C++ `shared_ptr<>`-s for easier lifetime management. by dkorolev · Pull Request #182 · nodejs/node-addon-examples

Description: 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 require e...

Open Graph Description: 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...

X Description: Hi @gengjiawen, Was hoping for some feedback -- after experimenting with node-addon-api for a few days looks like I&#39;ve managed to wrap the extracted functions into C++ objects that do not r...

Opengraph URL: https://github.com/nodejs/node-addon-examples/pull/182

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/_view_fragments/voltron/pull_requests/show/:user_id/:repository/:id/pull_request_layout(.:format)
route-controllervoltron_pull_requests_fragments
route-actionpull_request_layout
fetch-noncev2:4ee9198b-7720-289d-8945-ff6a0b0c56d5
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id88BA:122E03:3B9C75A:5147192:6972E121
html-safe-noncee8590178c818a80a320c8537b5e1d2fe3262e385e4ec6b6d2d1b7cbeb7c9d015
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEJBOjEyMkUwMzozQjlDNzVBOjUxNDcxOTI6Njk3MkUxMjEiLCJ2aXNpdG9yX2lkIjoiNzM5ODgwMjgwNTIzOTI0MzA0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac94f20f2cf94cb999881333b1a2b23afdbb6de1fa17c83fcd9fdd6de1ca429b34
hovercard-subject-tagpull_request:623219531
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/pull_requests_fragments/pull_request_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/voltron/pull_requests/show/nodejs/node-addon-examples/182/pull_request_layout
twitter:imagehttps://opengraph.githubassets.com/a383f9ea0d913f1bc4005844990bd311a2ca43dab6a3e83ab79d30c7d42d28d9/nodejs/node-addon-examples/pull/182
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a383f9ea0d913f1bc4005844990bd311a2ca43dab6a3e83ab79d30c7d42d28d9/nodejs/node-addon-examples/pull/182
og:image:altHi @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:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedkorolev
hostnamegithub.com
expected-hostnamegithub.com
None824b30a290fe1f3775d1c3b755ace6ec71165752363f95d9255c1b87220040e4
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node-addon-examples git https://github.com/nodejs/node-addon-examples.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id7768093
octolytics-dimension-repository_nwonodejs/node-addon-examples
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id7768093
octolytics-dimension-repository_network_root_nwonodejs/node-addon-examples
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7ef892904a22cef6ce15e4347cbf70e4cbfdc883
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://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 AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://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
Reloadhttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
Reloadhttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
Reloadhttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
nodejs https://patch-diff.githubusercontent.com/nodejs
node-addon-exampleshttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples
Please reload this pagehttps://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 servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://patch-diff.githubusercontent.com/login?return_to=%2Fnodejs%2Fnode-addon-examples%2Fissues%2Fnew%2Fchoose
Jump to bottomhttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issue-comment-box
dkorolevhttps://patch-diff.githubusercontent.com/dkorolev
nodejs:mainhttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/tree/main
dkorolev:cpp_thread_safe_callshttps://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
dkorolevhttps://patch-diff.githubusercontent.com/dkorolev
nodejs:mainhttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/tree/main
dkorolev:cpp_thread_safe_callshttps://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
dkorolevhttps://patch-diff.githubusercontent.com/dkorolev
Apr 26, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issue-867568179
@gengjiawenhttps://github.com/gengjiawen
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
dkorolevhttps://patch-diff.githubusercontent.com/dkorolev
April 26, 2021 15:44https://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
fd69c1chttps://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
bec0440https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/commits/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2
https://patch-diff.githubusercontent.com/dkorolev
dkorolevhttps://patch-diff.githubusercontent.com/dkorolev
Apr 26, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#event-4644190232
https://patch-diff.githubusercontent.com/mhdawson
mhdawsonhttps://patch-diff.githubusercontent.com/mhdawson
May 6, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issuecomment-833879032
@KevinEadyhttps://github.com/KevinEady
@gabrielschulhofhttps://github.com/gabrielschulhof
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
https://patch-diff.githubusercontent.com/mhdawson
mhdawsonhttps://patch-diff.githubusercontent.com/mhdawson
Jun 22, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issuecomment-866255320
@KevinEadyhttps://github.com/KevinEady
@gabrielschulhofhttps://github.com/gabrielschulhof
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
https://patch-diff.githubusercontent.com/KevinEady
KevinEadyhttps://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
KevinEadyhttps://patch-diff.githubusercontent.com/KevinEady
https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#pullrequestreview-690031165
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
@dkorolevhttps://github.com/dkorolev
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
thread_safe_function_counting_wrapped/node-addon-api/addon.cchttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2#diff-893f0d68888252aac14a0c36788b5be62065da12d5968442ca4f0ec7c3b75ad4
KevinEadyhttps://patch-diff.githubusercontent.com/KevinEady
Jun 22, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r656607207
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Value::Fromhttps://github.com/nodejs/node-addon-api/blob/main/doc/value.md#from
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
thread_safe_function_counting_wrapped/node-addon-api/addon.cchttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2#diff-893f0d68888252aac14a0c36788b5be62065da12d5968442ca4f0ec7c3b75ad4
KevinEadyhttps://patch-diff.githubusercontent.com/KevinEady
Jun 22, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r656615249
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
dkorolevhttps://patch-diff.githubusercontent.com/dkorolev
Jun 25, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r658606324
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
thishttps://github.com/C5T/Current/blob/stable/examples/nodejs/test.js
thishttps://github.com/C5T/Current/blob/stable/examples/nodejs_external_server/run.js
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
thread_safe_function_counting_wrapped/node-addon-api/addon.cchttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182/files/bec0440cbaaeb6c164dcf09689b0b1b05fbc03d2#diff-893f0d68888252aac14a0c36788b5be62065da12d5968442ca4f0ec7c3b75ad4
KevinEadyhttps://patch-diff.githubusercontent.com/KevinEady
Jun 22, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r656616979
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
dkorolevhttps://patch-diff.githubusercontent.com/dkorolev
Jun 25, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#discussion_r658607065
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
C5T/Current#904https://github.com/C5T/Current/issues/904
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
https://patch-diff.githubusercontent.com/dkorolev
dkorolevhttps://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
mhdawsonhttps://patch-diff.githubusercontent.com/mhdawson
Sep 3, 2021https://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182#issuecomment-912597598
@KevinEadyhttps://github.com/KevinEady
Please reload this pagehttps://patch-diff.githubusercontent.com/nodejs/node-addon-examples/pull/182
Sign up for freehttps://patch-diff.githubusercontent.com/join?source=comment-repo
Sign in to commenthttps://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 pagehttps://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
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.