#include #include #include "dal.h" static void _InitSQLite(const Napi::CallbackInfo& args) { Napi::Buffer buf = args[0].As>(); char * charstr = reinterpret_cast(buf.Data()); InitSQLite(charstr); } static Napi::Value Handle(const Napi::CallbackInfo& args) { Napi::Buffer buf = args[0].As>(); char * charstr = reinterpret_cast(buf.Data()); GoSlice result = HandleQuery(charstr); return Napi::Buffer::Copy(args.Env(), reinterpret_cast(result.data), result.len); } static Napi::Object Init(Napi::Env env, Napi::Object exports) { exports["InitSQLite"] = Napi::Function::New(env, _InitSQLite); exports["Handle"] = Napi::Function::New(env, Handle); return exports; } NODE_API_MODULE(NODE_GYP_MODULE_NAME, Init)