NodeJS C/C++扩展之Hello World~

  • Post author:
  • Post category:其他


先看官方文档

Addons

Node.js Addons are dynamically-linked shared objects, written in C or C++, that can be loaded into Node.js using the require() function, and used just as if they were an ordinary Node.js module. They are used primarily to provide an interface between JavaScript running in Node.js and C/C++ libraries.

Node的插件是动态连接到共享对象上的,可以使用C/C++编写,并能够使用require()语法,使用方法类似于其他的npm模块。Node插件主要用于提供一个接口,使得Javascript能够使用到C/C++类库。

At the moment, the method for implementing Addons is rather complicated, involving knowledge of several components and APIs :

目前,实现插件的方法相当复杂,涉及到多种组件和API的知识:


·

V8: the C++ library Node.js currently uses to provide the JavaScript implementation. V8 provides the mechanisms for creating objects, calling functions, etc. V8’s API is documented mostly in the v8.h header file (deps/v8/include/v8.h in the Node.js source tree), whic



版权声明:本文为u010312740原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。