René's URL Explorer Experiment


Title: How to reference node_api.h properly since it was removed? · Issue #882 · nodejs/node-addon-api · GitHub

Open Graph Title: How to reference node_api.h properly since it was removed? · Issue #882 · nodejs/node-addon-api

X Title: How to reference node_api.h properly since it was removed? · Issue #882 · nodejs/node-addon-api

Description: I apologize if this is not the right place for this but I'm not sure where the best place to start is. Since #643 removed external-napi/node_api.h from published versions, what is the recommended way to have IntelliSense (and other code ...

Open Graph Description: I apologize if this is not the right place for this but I'm not sure where the best place to start is. Since #643 removed external-napi/node_api.h from published versions, what is the recommended w...

X Description: I apologize if this is not the right place for this but I'm not sure where the best place to start is. Since #643 removed external-napi/node_api.h from published versions, what is the recommend...

Opengraph URL: https://github.com/nodejs/node-addon-api/issues/882

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"How to reference node_api.h properly since it was removed?","articleBody":"I apologize if this is not the right place for this but I'm not sure where the best place to start is.\r\n\r\nSince #643 removed `external-napi/node_api.h` from published versions, what is the recommended way to have IntelliSense (and other code linters/hinters) \"see\" that file (or, really, the right one)?\r\n\r\nThis is a similar problem for the node-addon-api header files that is usually solved with something like this: `node -p \"require('node-addon-api').include\"`. For my purposes, I've noticed that this path is always `${workspaceFolder}/node_modules/node-addon-api` so I'm using that for now.\r\n\r\nI've been looking for a way to consistently setup developers' environments to point to the real `node_api.h` that's currently in use. Specifically, I'm interested in setting up VS Code for this problem with `.vscode/c_cpp_properties.json#configurations[0].includePath`.\r\n\r\nThis SO question has part of an answer: https://stackoverflow.com/questions/61730307/node-js-native-addons-where-is-node-api-h-located\r\n\r\nHowever it's fundamentally flawed (at least for my purposes) in two ways:\r\n - It references an absolute, OS specific, location\r\n - Untrivial to parameterize around node version\r\n\r\nI've tried things like `npm i node` to see if the locally installed version has the header file that I can reference. Alas the binary distribution of Node doesn't include the `node_api.h` header.\r\n\r\nMy current best solution is to instruct developers to put the path for their system that matches the SO answer into their local user configuration files and then having something like this in the committed `.vscode/c_cpp_properties.json`:\r\n\r\n```json\r\n{\r\n  \"configurations\": [\r\n    {\r\n      \"name\": \"gcc-node\",\r\n      \"includePath\": [\r\n        \"${workspaceFolder}/node_modules/node-addon-api\",\r\n        \"${config:local.node-gyp.node-cache}/include/node\"\r\n      ]\r\n    }\r\n  ],\r\n  \"version\": 4\r\n}\r\n```\r\nUser Settings\r\n```settings.json\r\n{\r\n  \"local.node-gyp.node-cache\": \"C:/Users/\u003cUserName\u003e/AppData/Local/node-gyp/Cache/\u003cNodeVersion\u003e\"\r\n}\r\n```\r\n\r\nBut I feel like there should be something better than this...\r\n\r\nThanks for the look! Cheers!","author":{"url":"https://github.com/cinderblock","@type":"Person","name":"cinderblock"},"datePublished":"2021-01-21T02:23:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/882/node-addon-api/issues/882"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c0ee4308-fb6a-843f-0e73-277164874cdb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE8FC:E2378:52207EC:722DA5A:6A4F7763
html-safe-noncef3de177e9e769899d6ff4e3c0f449e2b6101f1ba49d5d936687a07cf3df6e4e6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEZDOkUyMzc4OjUyMjA3RUM6NzIyREE1QTo2QTRGNzc2MyIsInZpc2l0b3JfaWQiOiI0OTczNDgxNjA5ODIwODYyMzA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac34a0a05e296a4b752fe59e40d5268d9178c28549a3095fea663ef467becea42c
hovercard-subject-tagissue:790624765
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node-addon-api/882/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1c3ad937cda0e3977f111009865f3c19414435d41e9c31e6e7ff8d7b749b5f1b/nodejs/node-addon-api/issues/882
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1c3ad937cda0e3977f111009865f3c19414435d41e9c31e6e7ff8d7b749b5f1b/nodejs/node-addon-api/issues/882
og:image:altI apologize if this is not the right place for this but I'm not sure where the best place to start is. Since #643 removed external-napi/node_api.h from published versions, what is the recommended w...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecinderblock
hostnamegithub.com
expected-hostnamegithub.com
Noneb92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node-addon-api git https://github.com/nodejs/node-addon-api.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id81384578
octolytics-dimension-repository_nwonodejs/node-addon-api
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81384578
octolytics-dimension-repository_network_root_nwonodejs/node-addon-api
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
release4b249b445842943ed31549e027f57a8ade9881ed
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node-addon-api/issues/882#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode-addon-api%2Fissues%2F882
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode-addon-api%2Fissues%2F882
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode-addon-api
Reloadhttps://github.com/nodejs/node-addon-api/issues/882
Reloadhttps://github.com/nodejs/node-addon-api/issues/882
Reloadhttps://github.com/nodejs/node-addon-api/issues/882
Please reload this pagehttps://github.com/nodejs/node-addon-api/issues/882
nodejs https://github.com/nodejs
node-addon-apihttps://github.com/nodejs/node-addon-api
Please reload this pagehttps://github.com/nodejs/node-addon-api/issues/882
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode-addon-api
Fork 500 https://github.com/login?return_to=%2Fnodejs%2Fnode-addon-api
Star 2.4k https://github.com/login?return_to=%2Fnodejs%2Fnode-addon-api
Code https://github.com/nodejs/node-addon-api
Issues 10 https://github.com/nodejs/node-addon-api/issues
Pull requests 4 https://github.com/nodejs/node-addon-api/pulls
Actions https://github.com/nodejs/node-addon-api/actions
Projects https://github.com/nodejs/node-addon-api/projects
Wiki https://github.com/nodejs/node-addon-api/wiki
Security and quality 0 https://github.com/nodejs/node-addon-api/security
Insights https://github.com/nodejs/node-addon-api/pulse
Code https://github.com/nodejs/node-addon-api
Issues https://github.com/nodejs/node-addon-api/issues
Pull requests https://github.com/nodejs/node-addon-api/pulls
Actions https://github.com/nodejs/node-addon-api/actions
Projects https://github.com/nodejs/node-addon-api/projects
Wiki https://github.com/nodejs/node-addon-api/wiki
Security and quality https://github.com/nodejs/node-addon-api/security
Insights https://github.com/nodejs/node-addon-api/pulse
How to reference node_api.h properly since it was removed?https://github.com/nodejs/node-addon-api/issues/882#top
https://github.com/cinderblock
cinderblockhttps://github.com/cinderblock
on Jan 21, 2021https://github.com/nodejs/node-addon-api/issues/882#issue-790624765
#643https://github.com/nodejs/node-addon-api/pull/643
https://stackoverflow.com/questions/61730307/node-js-native-addons-where-is-node-api-h-locatedhttps://stackoverflow.com/questions/61730307/node-js-native-addons-where-is-node-api-h-located
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.