mirror of https://github.com/nodejs/node.git
17 lines
366 B
C++
17 lines
366 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
using namespace v8;
|
|
|
|
void Method(const FunctionCallbackInfo<Value>& args) {
|
|
Isolate* isolate = Isolate::GetCurrent();
|
|
HandleScope scope(isolate);
|
|
args.GetReturnValue().Set(String::NewFromUtf8(isolate, "world"));
|
|
}
|
|
|
|
void init(Handle<Object> target) {
|
|
NODE_SET_METHOD(target, "hello", Method);
|
|
}
|
|
|
|
NODE_MODULE(binding, init);
|