Last active
October 2, 2015 12:48
-
-
Save lupomontero/2245562 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <node.h> | |
namespace cpphello { | |
using v8::FunctionCallbackInfo; | |
using v8::Isolate; | |
using v8::Local; | |
using v8::Object; | |
using v8::String; | |
using v8::Value; | |
void Foo(const FunctionCallbackInfo<Value>& args) { | |
Isolate* isolate = args.GetIsolate(); | |
args.GetReturnValue().Set(String::NewFromUtf8(isolate, "Hello World")); | |
} | |
void Init(Local<Object> exports) { | |
NODE_SET_METHOD(exports, "foo", Foo); | |
} | |
NODE_MODULE(cpphello, Init) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment