mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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>
18 lines
342 B
C++
18 lines
342 B
C++
#include <v8.h>
|
|
#include <node.h>
|
|
|
|
using namespace v8;
|
|
|
|
static int c = 0;
|
|
|
|
void Hello(const FunctionCallbackInfo<Value>& args) {
|
|
args.GetReturnValue().Set(c++);
|
|
}
|
|
|
|
extern "C" void init (Local<Object> target) {
|
|
HandleScope scope(Isolate::GetCurrent());
|
|
NODE_SET_METHOD(target, "hello", Hello);
|
|
}
|
|
|
|
NODE_MODULE(NODE_GYP_MODULE_NAME, init)
|