wilix-team / iohook

Node.js global keyboard and mouse listener.
https://wilix-team.github.io/iohook
MIT License
1.18k stars 290 forks source link

change nan to node-addon-api #430

Closed eezz4 closed 1 year ago

eezz4 commented 1 year ago

Description

I erased all the code, leaving only the NAN entry point, and the program crashed.

Motivation and Context

https://nodejs.github.io/node-addon-examples/about/what/#node-api It is described as removing dependencies on the node version.

How Has This Been Tested?

All the tests in the existing project were failing. And resources were not being released.

So I added some temporary test code to remove the Entry point segment fault issue and the resource not releasing issue. Presumably this removes the 'known issue' of not working on Windows.

Since the build environment requires a download, I checked the local code for my personal project and the pkg build as shown in the screenshot.

Due to lack of time, I can't change all the build code, so I pulled requested only that code. For now, I'm only going to use it as a build environment for my forked project.

It looks like there is more work to be done, such as versioning. Please review the part about resetting to version 2 of package-lock.json. I don't have any experience publishing to npm, so I don't know if it's okay.

Screenshots (if appropriate):

use manual build Windows 11, node 16.19.1

image

Types of changes

Checklist: