Skip to content

Instantly share code, notes, and snippets.

@hisasann
Created February 15, 2017 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hisasann/3c08ad66199eea5694e0b73a8735b6fd to your computer and use it in GitHub Desktop.
Save hisasann/3c08ad66199eea5694e0b73a8735b6fd to your computer and use it in GitHub Desktop.
node native addon using nan
#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