- Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathcpphello.cpp
More file actions
Latest commit
24 lines (17 loc) · 470 Bytes
/
Copy pathcpphello.cpp
File metadata and controls
24 lines (17 loc) · 470 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<node.h>
namespacecpphello {
using v8::FunctionCallbackInfo;
using v8::Isolate;
using v8::Local;
using v8::Object;
using v8::String;
using v8::Value;
voidFoo(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
args.GetReturnValue().Set(String::NewFromUtf8(isolate, "Hello World"));
}
voidInit(Local<Object> exports) {
NODE_SET_METHOD(exports, "foo", Foo);
}
NODE_MODULE(cpphello, Init)
}