native-is-elevated
Advanced tools
Comparing version 0.4.3 to 0.5.0
12
index.js
@@ -8,3 +8,11 @@ 'use strict'; | ||
module.exports = function isElevated () { | ||
module.exports = function isElevated() { | ||
if (process.platform === 'win32') { | ||
return isElevatedWindows(); | ||
} | ||
return process.getuid() === 0; | ||
}; | ||
function isElevatedWindows() { | ||
if (returned) { | ||
@@ -37,2 +45,2 @@ return retValue; | ||
return retValue; | ||
}; | ||
} |
{ | ||
"name": "native-is-elevated", | ||
"version": "0.4.3", | ||
"version": "0.5.0", | ||
"description": "Native module for checking if the process is being run with elevated privileges", | ||
@@ -8,8 +8,7 @@ "main": "index.js", | ||
"engine": { | ||
"node": ">=10.0.0" | ||
"node": ">=12.0.0" | ||
}, | ||
"scripts": { | ||
"configure": "node-gyp configure", | ||
"build": "node-gyp build", | ||
"test": "ava" | ||
"build": "node-gyp build" | ||
}, | ||
@@ -25,6 +24,3 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/arkon/native-is-elevated#readme", | ||
"devDependencies": { | ||
"ava": "^3.13.0" | ||
} | ||
"homepage": "https://github.com/arkon/native-is-elevated#readme" | ||
} |
@@ -5,3 +5,3 @@ # native-is-elevated | ||
Checks if the process is running with elevated privileges (as root on Unix systems, and as Administrator on Windows). | ||
Checks if the process is running with elevated privileges (i.e., as root on Unix systems or Administrator on Windows). | ||
@@ -8,0 +8,0 @@ Basically just a [native version](https://nodejs.org/api/addons.html) of [is-elevated](https://github.com/sindresorhus/is-elevated). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5592
0
10
43