Skip to content

Commit

Permalink
Make it Electron 7 compatible (#4)
Browse files Browse the repository at this point in the history
* chore: make keytar context aware (atom#182)

* chore: update nan to 2.14.0

* chore: bump version to 4.2.1

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
  • Loading branch information
2 people authored and juturu committed Jan 20, 2020
1 parent 46b213a commit 09ae1a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"main": "./lib/keytar.js",
"name": "keytar4",
"description": "Bindings to native Mac/Linux/Windows password APIs",
"version": "4.2.0",
"version": "4.2.1",
"license": "MIT",
"repository": {
"type": "git",
Expand Down Expand Up @@ -35,6 +35,6 @@
"node-gyp": "^3.6.0"
},
"dependencies": {
"nan": "2.11.1"
"nan": "2.14.0"
}
}
14 changes: 9 additions & 5 deletions src/main.cc
Expand Up @@ -38,13 +38,17 @@ NAN_METHOD(FindPassword) {
Nan::AsyncQueueWorker(worker);
}

void Init(v8::Handle<v8::Object> exports) {
Nan::SetMethod(exports, "getPassword", GetPassword);
Nan::SetMethod(exports, "setPassword", SetPassword);
Nan::SetMethod(exports, "deletePassword", DeletePassword);
Nan::SetMethod(exports, "findPassword", FindPassword);
NAN_MODULE_INIT(Init) {
Nan::SetMethod(target, "getPassword", GetPassword);
Nan::SetMethod(target, "setPassword", SetPassword);
Nan::SetMethod(target, "deletePassword", DeletePassword);
Nan::SetMethod(target, "findPassword", FindPassword);
}

} // namespace

#if NODE_MAJOR_VERSION >= 10
NAN_MODULE_WORKER_ENABLED(keytar, Init)
#else
NODE_MODULE(keytar, Init)
#endif

0 comments on commit 09ae1a1

Please sign in to comment.