#include #include using namespace v8; static int c = 0; void Hello(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(c++); } extern "C" void init (Local target) { HandleScope scope(Isolate::GetCurrent()); NODE_SET_METHOD(target, "hello", Hello); } NODE_MODULE(NODE_GYP_MODULE_NAME, init)