• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <node.h>
2 #include <v8.h>
3 
Method(const v8::FunctionCallbackInfo<v8::Value> & args)4 void 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,v8::Local<v8::Object> module)10 void init(v8::Local<v8::Object> exports, v8::Local<v8::Object> module) {
11   NODE_SET_METHOD(module, "exports", Method);
12 }
13 
14 NODE_MODULE(NODE_GYP_MODULE_NAME, init)
15