elevated

1.1.5 • Public • Published

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 elevated

Yarn

yarn add elevated

Usage 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();

Package Sidebar

Install

npm i elevated

Weekly Downloads

11

Version

1.1.5

License

ISC

Unpacked Size

1.96 kB

Total Files

3

Last publish

Collaborators

  • cedrictailly