Created
February 15, 2017 10:42
-
-
Save hisasann/3c08ad66199eea5694e0b73a8735b6fd to your computer and use it in GitHub Desktop.
node native addon using nan
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 <nan.h> | |
void Method(const Nan::FunctionCallbackInfo<v8::Value>& info) { | |
info.GetReturnValue().Set(Nan::New("world").ToLocalChecked()); | |
} | |
void Init(v8::Local<v8::Object> exports) { | |
exports->Set(Nan::New("hello").ToLocalChecked(), | |
Nan::New<v8::FunctionTemplate>(Method)->GetFunction()); | |
} | |
NODE_MODULE(hello, Init) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment