1.1.5 • Published 3 years ago
elevated v1.1.5
elevated
Check if script is executed in an elevated mode :
- Using SUDO on Linux.
- From an administrator account on Windows.
No support for other platforms like MacOS with this version but I'm opened to pull requests.
Installation
NPM
npm install -s elevatedYarn
yarn add elevatedUsage examples
elevated.check()
console.log(
require('elevated').check() ? 'elevated' : 'unelevated'
);elevated.required()
This way an exception is thrown with a platform specific message if the runtime is not elevated.
require('elevated').required();