mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 15:06:33 +01:00
78286984da
Currently the nm_modname does not match the file name of the resulting module. In fact, the nm_modname is pretty arbitrary. This seeks to introduce some consistency into the nm_modname property by having the name of the module appear in exactly one place: the "target_name" property of the gyp target that builds the module. PR-URL: https://github.com/nodejs/node/pull/15209 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
14 lines
379 B
C++
14 lines
379 B
C++
#include <node.h>
|
|
#include <v8.h>
|
|
|
|
void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|
v8::Isolate* isolate = args.GetIsolate();
|
|
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, "world"));
|
|
}
|
|
|
|
void init(v8::Local<v8::Object> exports, v8::Local<v8::Object> module) {
|
|
NODE_SET_METHOD(module, "exports", Method);
|
|
}
|
|
|
|
NODE_MODULE(NODE_GYP_MODULE_NAME, init)
|