#pragma comment(lib, "node") #include #include #include #include "SharpLibHelper.h" using namespace node; using namespace v8; class SharpObject: ObjectWrap { private: SharpLibHelper* _sharpLibHelper; public: static Persistent s_ct; static void NODE_EXTERN Init(Handle target) { HandleScope scope; target->Set(v8::String::NewSymbol("Sharp"), FunctionTemplate::New(SharpLibHelper::Instance)->GetFunction()); } }; Persistent SharpObject::s_ct; extern "C" { void NODE_EXTERN init (Handle target) { SharpObject::Init(target); // Load Assembly is a global method defined in SharpLibHelper. // It attaches a hander to AssemblyLoad to search the active directory. LoadAssembly(); } // 'sharp' here is treated as a string within the macro NODE_MODULE(sharp, init); }