mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
PR-URL: https://github.com/nodejs/node/pull/59805 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
18 lines
530 B
C++
18 lines
530 B
C++
#include <node.h>
|
|
#include <uv.h>
|
|
#include <v8.h>
|
|
|
|
static void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
v8::Isolate* isolate = args.GetIsolate();
|
|
args.GetReturnValue().Set(
|
|
v8::String::NewFromUtf8(isolate, "hello world").ToLocalChecked());
|
|
}
|
|
|
|
static void InitModule(v8::Local<v8::Object> exports,
|
|
v8::Local<v8::Value> module,
|
|
v8::Local<v8::Context> context) {
|
|
NODE_SET_METHOD(exports, "default", Method);
|
|
}
|
|
|
|
NODE_MODULE_CONTEXT_AWARE(Binding, InitModule)
|