Skip to content

Instantly share code, notes, and snippets.

@ramirezd42
Created October 25, 2017 05:02
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 ramirezd42/38ae06bd5064bdce88234c16e07d2587 to your computer and use it in GitHub Desktop.
Save ramirezd42/38ae06bd5064bdce88234c16e07d2587 to your computer and use it in GitHub Desktop.
ex_0
#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