mirror of
https://github.com/nodejs/node.git
synced 2026-11-15 10:36:53 -05:00
Co-Authored-By: Michaël Zasso <targos@protonmail.com> PR-URL: https://github.com/nodejs/node/pull/58070 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.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)
|