diff --git a/src/main.cc b/src/main.cc index c193ae54..3218941e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -65,14 +65,18 @@ NAN_METHOD(FindCredentials) { Nan::AsyncQueueWorker(worker); } -void Init(v8::Local exports) { - Nan::SetMethod(exports, "getPassword", GetPassword); - Nan::SetMethod(exports, "setPassword", SetPassword); - Nan::SetMethod(exports, "deletePassword", DeletePassword); - Nan::SetMethod(exports, "findPassword", FindPassword); - Nan::SetMethod(exports, "findCredentials", FindCredentials); +NAN_MODULE_INIT(Init) { + Nan::SetMethod(target, "getPassword", GetPassword); + Nan::SetMethod(target, "setPassword", SetPassword); + Nan::SetMethod(target, "deletePassword", DeletePassword); + Nan::SetMethod(target, "findPassword", FindPassword); + Nan::SetMethod(target, "findCredentials", FindCredentials); } } // namespace +#if NODE_MAJOR_VERSION >= 10 +NAN_MODULE_WORKER_ENABLED(keytar, Init) +#else NODE_MODULE(keytar, Init) +#endif