mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
19 lines
334 B
C++
19 lines
334 B
C++
#include <v8.h>
|
|
#include <node.h>
|
|
|
|
using namespace v8;
|
|
|
|
static int c = 0;
|
|
|
|
static Handle<Value> Hello(const Arguments& args) {
|
|
HandleScope scope;
|
|
return scope.Close(Integer::New(c++));
|
|
}
|
|
|
|
extern "C" void init (Handle<Object> target) {
|
|
HandleScope scope;
|
|
NODE_SET_METHOD(target, "hello", Hello);
|
|
}
|
|
|
|
NODE_MODULE(binding, init);
|