node/test/addons/hello-world-2/binding.cc
StefanStojanovic 05aa3a1c70
test,win: split addon tests
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>
2025-10-04 18:48:46 +02:00

22 lines
717 B
C++

// Include uv.h and v8.h ahead of node.h to verify that node.h doesn't need to
// be included first. Disable clang-format as it will sort the include lists.
// clang-format off
#include <uv.h>
#include <v8.h>
#include <node.h>
// clang-format on
static void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
args.GetReturnValue().Set(
v8::String::NewFromUtf8(isolate, "world").ToLocalChecked());
}
static void InitModule(v8::Local<v8::Object> exports,
v8::Local<v8::Value> module,
v8::Local<v8::Context> context) {
NODE_SET_METHOD(exports, "hello", Method);
}
NODE_MODULE(NODE_GYP_MODULE_NAME, InitModule)