-
-
Save xealgo/86bab21567dcc6498211 to your computer and use it in GitHub Desktop.
basic nodejs c++ module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <v8.h> | |
#include <node.h> | |
using namespace node; | |
using namespace v8; | |
static Handle<Value> test_prnt(const Arguments& args) | |
{ | |
Local<String> s1 = String::New("The cow says: "); | |
Local<String> s2 = args[0]->ToString(); | |
return String::Concat(s1, s2); | |
} | |
extern "C" void init(Handle<Object> target) | |
{ | |
NODE_SET_METHOD(target, "test_prnt", test_prnt); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment