Node.js C++ 插件学习指南

Node.js插件(addons)

Node.js 插件是用 C++ 编写的动态链接共享对象,可以使用 require() 函数加载到 Node.js 中,且像普通的 Node.js 模块一样被使用。 它们主要用于为运行在 Node.js 中的 JavaScript 与 C/C++ 库之间提供接口。

基础文档:http://nodejs.cn/api/addons.html

进阶文档:https://nodeaddons.com/

node-gyp

Node.js 插件构建工具。

文档地址:https://github.com/nodejs/node-gyp

node-gyp binding.gyp

binding.gyp配置文件的参数说明。

文档地址:https://gyp.gsrc.io/docs/UserDocumentation.md

node-gyp binding.gyp 例子

一些Node.js 插件的binding.gyp文件示例。

链接地址:https://github.com/nodejs/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild

node-pre-gyp

它只是一个工具,可以让发布和安装Node.js C ++插件更容易。

文档地址:https://nodeaddons.com/cross-platform-addons-with-node-pre-gyp/

posted @ 2019-07-20 11:57  海角在眼前  阅读(1230)  评论(0编辑  收藏  举报