Hello world.
arkon / native-is-elevated Goto Github PK
View Code? Open in Web Editor NEWChecks if the process is running with elevated privileges.
License: MIT License
Checks if the process is running with elevated privileges.
License: MIT License
@arkon briefly checking index.js
I would have expected the result of the check for being admin or not to get cached after the first call and then used from there always. Afaik the result can not change in the current process so imho it would be safer (and faster) to cache the result.
It seems to be cached here in case we found out that the process is not running as admin, but why is the call still being made otherwise?
As suggested in #3
I'm working under an unprivileged user account and can't elevate it because UAC is disabled, though this module (as part of VSCode) shows that it's running under admin. More info in the VSCode issue
I have a core package myapp-core
which has native-is-elevated
as a dependency. Everything builds and runs fine.
myapp
|--myapp-core
|--native-is-elevated
However when I then install myapp-core
as a dependency of myapp
, I get a runtime error:
Module not found: Can't resolve './build/Release/iselevated' in '/Users/username/Sites/myapp/node_modules/native-is-elevated'
It appears that the path ./build/Release/iselevated
is not resolving for nested dependencies.
Should this path be defined using __filename and __dirname variables?
All paths should also be cross-platform safe using path.join()
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.