1 #include <node.h> 2 #include <v8.h> 3 Method(const v8::FunctionCallbackInfo<v8::Value> & args)4void Method(const v8::FunctionCallbackInfo<v8::Value>& args) { 5 v8::Isolate* isolate = args.GetIsolate(); 6 args.GetReturnValue().Set(v8::String::NewFromUtf8( 7 isolate, "world").ToLocalChecked()); 8 } 9 init(v8::Local<v8::Object> exports)10void init(v8::Local<v8::Object> exports) { 11 NODE_SET_METHOD(exports, "hello", Method); 12 } 13 14 NODE_MODULE(NODE_GYP_MODULE_NAME, init) 15