Skip to content

Commit

Permalink
Update to using latest recommended node-add on API, #67
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Jun 30, 2021
1 parent b282e19 commit 1bd33f0
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/node-lmdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@
using namespace v8;
using namespace node;

extern "C" {
extern "C" NODE_MODULE_EXPORT void
NODE_MODULE_INITIALIZER(Local<Object> exports,
Local<Value> module,
Local<Context> context) {
// Initializes the module
void initializeModule(Local<Object> exports) {
// Export Env as constructor for EnvWrap
EnvWrap::setupExports(exports);
// Export Env as constructor for EnvWrap
EnvWrap::setupExports(exports);

// Export Cursor as constructor for CursorWrap
CursorWrap::setupExports(exports);
// Export Cursor as constructor for CursorWrap
CursorWrap::setupExports(exports);

// Export misc things
setupExportMisc(exports);
}

// Context-aware, ie. thread safe
NODE_MODULE_CONTEXT_AWARE(lmdb, initializeModule)
// Export misc things
setupExportMisc(exports);
}

0 comments on commit 1bd33f0

Please sign in to comment.