Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-elevated

sindresorhus87.6kMIT4.0.0TypeScript support: included

Check if the process is running with elevated privileges

admin, administrator, win32, windows, process, running, cmd, shell, command-line, check, detect, is, root, sudo, elevate, elevated, privileges

readme

is-elevated

Check if the process is running with elevated privileges

By checking if the process is root on Unix systems or if the user is administrator on Windows.

Keep in mind that root and Administrator mean different things so this module might not be suitable for your use-case.

Install

$ npm install is-elevated

Usage

import isElevated from 'is-elevated';

console.log(await isElevated());
//=> false
  • sudo-block - Block users from running your app with root permissions