I tried many ways and npm packages to achieve this. But no luck. I am able to do this with only
EDIT:
These are the versions that worked for me:
C:\Users\abc>node -v
v18.12.1
"devDependencies": {
"electron": "^19.0.0"
},
"dependencies": {
"ffi-napi": "^4.0.3",
"ref-union-di": "^1.0.1",
"win32-api": "^20.1.0"
}