2015-09-20 06:03:32 +08:00
|
|
|
#include <node.h>
|
|
|
|
#include <v8.h>
|
|
|
|
|
|
|
|
void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
|
|
v8::Isolate* isolate = args.GetIsolate();
|
2018-11-07 14:50:51 +08:00
|
|
|
args.GetReturnValue().Set(v8::String::NewFromUtf8(
|
2020-07-08 04:03:17 +08:00
|
|
|
isolate, "world").ToLocalChecked());
|
2015-09-20 06:03:32 +08:00
|
|
|
}
|
|
|
|
|
2016-10-18 00:53:40 +08:00
|
|
|
void init(v8::Local<v8::Object> exports) {
|
|
|
|
NODE_SET_METHOD(exports, "hello", Method);
|
2015-09-20 06:03:32 +08:00
|
|
|
}
|
|
|
|
|
2017-09-06 04:53:06 +08:00
|
|
|
NODE_MODULE(NODE_GYP_MODULE_NAME, init)
|