summaryrefslogtreecommitdiff
path: root/test/addons/symlinked-module/binding.cc
blob: 02eecec099807a1add9d1fdc8dad4e0798abd7cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <node.h>
#include <v8.h>

void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
  v8::Isolate* isolate = args.GetIsolate();
  args.GetReturnValue().Set(v8::String::NewFromUtf8(
        isolate, "world", v8::NewStringType::kNormal).ToLocalChecked());
}

void init(v8::Local<v8::Object> exports) {
  NODE_SET_METHOD(exports, "hello", Method);
}

NODE_MODULE(NODE_GYP_MODULE_NAME, init)