I have the following code in javascript:

var c = new addon.Component();
c.ComponentLength = 3

How should i build my addon, so i can do the previous code? I've already followed the tutorials in http://nodejs.org/api/addons.html , but i'm stuck here.

Is this possible? Does anyone have a solution?

Thanks in advance.

有帮助吗?

解决方案

The solution is on the v8.h, search for SetAccessor , which "Sets an accessor on the object template.".

An example: http://syskall.com/how-to-write-your-own-native-nodejs-extension/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top