-
node c++ addondev/C,C++ 2022. 3. 14. 10:49
node 에서 사용가능한 모듈을 c/c++ 로 개발.
https://nodejs.org/dist/latest-v16.x/docs/api/n-api.html
Node-API | Node.js v16.14.0 Documentation
nodejs.org
관련 대부분의 문서에 윈도우 기준 windows-build-tool 을 설치하는 단계가 있는데 windows-build-tools 공식 페이지에는 deprecated 라고 표시되고 현재는 nodejs 설치 패키지에 포함되어 있다고 설명이 되어있으므로 따로 설치할 필요가 없음.
참고로 windows-build-tools 는 node-gyp, python, vs compiler 를 설치, 설정 해주는 도구임.
문제시 각각을 수동으로 설치도 가능함.
만약 windows-build-tools 에 포함된 node-gyp 관련 오류시 참고.
https://github.com/nodejs/node-gyp
GitHub - nodejs/node-gyp: Node.js native addon build tool
Node.js native addon build tool. Contribute to nodejs/node-gyp development by creating an account on GitHub.
github.com
https://github.com/felixrieseberg/windows-build-tools
GitHub - felixrieseberg/windows-build-tools: Install C++ Build Tools for Windows using npm
:package: Install C++ Build Tools for Windows using npm - GitHub - felixrieseberg/windows-build-tools: Install C++ Build Tools for Windows using npm
github.com
설명 문서들에 python 2.x 를 사용하라고 되어있지만 현재기준 3.10 버전에서도 잘 동작함.
vs 버전도 Visual stodio 2019 에서도 정상 동작.
https://nodejs.github.io/node-addon-examples/
GitHub - nodejs/node-addon-examples: Node.js C++ addon examples from http://nodejs.org/docs/latest/api/addons.html
Node.js C++ addon examples from http://nodejs.org/docs/latest/api/addons.html - GitHub - nodejs/node-addon-examples: Node.js C++ addon examples from http://nodejs.org/docs/latest/api/addons.html
github.com
위에서 설명된 문서와 예제 repo 를 참고하여 샘플 코드 작성, 실행 가능.
https://github.com/microsoft/nodejs-guidelines/blob/master/windows-environment.md
GitHub - microsoft/nodejs-guidelines: Tips, tricks, and resources for working with Node.js, and the start of an ongoing conversa
Tips, tricks, and resources for working with Node.js, and the start of an ongoing conversation on how we can improve the Node.js experience on Microsoft platforms. - GitHub - microsoft/nodejs-guide...
github.com
반대로 ms 에서도 nodejs 개발을 위한 가이드 문서를 제공.