$ npm i node-mac-admin
This native Node.js module allows you to get admin privilege on macOS
appId
String - eg. com.google.chrome
Return Value Descriptions:
throw exception
- Failednot throw exception
- OK
Example:
admin.ask("com.google.chrome").then(function(result){
console.info("ok!")
}).catch(function(msg){
console.error(msg)
})