47. 编译C/C++原生组件
node-gyp: Node.js native addon build tool
https://github.com/TooTallNate/node-gyp
How to build:
$ npm install -g node-gyp
$ cd my_node_addon
$ node-gyp configure
$ node-gyp build
Use:
var addon = require('./build/Release/addon');
More: http://nodejs.org/api/addons.html
48. run .NET and node.js code in-process
Edge.js
https://github.com/tjanczuk/edge
An edge connects two nodes. This edge connects
node.js and .NET. V8 and CLR. Node.js, Python, and
C# - in process.
安装:
$ npm install edge
49. run .NET and node.js code in-process
sample.js:
Run:
50. run .NET and node.js code in-process
//引入文件
var add7 = edge.func(__dirname + '/add7.csx');
//引入dll
var clrMethod = edge.func('My.Edge.Samples.dll');