Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

native-is-elevated

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

native-is-elevated - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

18

index.js
'use strict';
var isElevated = null;
var lib = null;
var tried = false;
var returned = false;
var retValue = false;
module.exports = function() {
if (returned) {
return retValue;
}
if (!tried) {
// Prevent multiple failed require attempts
tried = true;
try {
isElevated = require('./build/Release/is-elevated');
lib = require('./build/Release/is-elevated');
} catch (err) {

@@ -15,9 +22,10 @@ console.error(err);

if (!isElevated) {
if (!lib) {
return false;
}
var retValue = false;
try {
retValue = isElevated.isElevated();
// Cache the result for subsequent calls
retValue = lib.isElevated();
returned = true;
} catch (err) {

@@ -24,0 +32,0 @@ console.error(err);

{
"name": "native-is-elevated",
"version": "0.1.3",
"version": "0.2.0",
"description": "Native module for checking if the process is being run with elevated privileges",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc